Vince from Spain
Posts: 658 From: Madrid Spain Status: offline
|
RE: here's my code for displaying a record's id - 4/10/2001 20:22:00
Hi Bebe, have a look at this code, pretty much like yours but trimmed so I could test it. I have changed the type of connection which is important, but will work the same. One other important difference is that you have the constant for adOpenKeyset wrong, it should be . . . Const adOpenKeyset = 1If just changing this does not do it, change the connections to something like this . . . <% Dim name, url, tel, DSN_NAME, Conn, RS, SQL name="vbcvvbbvb" url="http:/nbnbnbnb.com" tel="6636363" DSN_NAME = "DBQ=" & Server.MapPath("test.mdb") & ";Driver={Microsoft Access Driver (*.mdb)}; MaxBufferSize=8192;Threads=20;" Set Conn = Server.CreateObject("ADODB.Connection") conn.open DSN_NAME, 3, 3 Const adOpenKeyset = 1 Const adLockOptimistic = 3 Const adCmdTable = 2 Set RS = Server.CreateObject("ADODB.Recordset") RS.Open "results", Conn, adOpenKeySet, adLockOptimistic, adCmdTable dim myID RS.ADDNEW RS("name") = name RS("url") = url RS("tel") = tel RS.Update myID = RS("ID") Response.Write myID Response.Write "<strong>SPOT</strong> -" Response.Write "This single record was added into the database. " & "<p>" Conn.close Set Conn=nothing %> ------------------ Internet Business Solutions S.L.(Spain)
|