Code:SET objConn = SERVER.CreateObject("ADODB.Connection") SET objRS = SERVER.CreateObject("ADODB.Recordset") coStr = "DRIVER={Microsoft Access Driver (*.mdb)};" coStr = coStr & "DBQ=" & Server.MapPath("db\db1.mdb") & ";" objConn.Open(coStr) objRS.Open "SELECT * FROM question1",objConn,2,2 objConn.Execute "INSERT INTO question1(field1) VALUES ('" & stringvalue & "');" 'kill objects set objRS = Nothing objConn.Close SET objConn=Nothinghigher? So shouldn't the path be1) data base is 1 level higher in a folder called db
coStr = coStr & "DBQ=" & Server.MapPath("../db1.mdb") & ";"
The .AddNew method is rather, uhm.... stupid. With the INSERT string above, you can be sure the autonumber field gets auto-incremented.




Reply With Quote