![]() |
|
|
+ Search |
![]()
|
Feb 2nd, 2001 01:36
Acebone, Spy,
You will need the file adovbs.asp. This file defines a lot of ADODB constants. You can probably get it at http://www.microsoft.com. Your ASP file may look something like this: <!--#Include File="adovbs.asp"--> <% 'Create a database connection Set dbConn = Server.CreateObject("ADODB.Connection") dbConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\PATH\TO\YOUR\DATABASE\database.mdb" 'Create a recordset object Set rsNt = Server.CreateObject("ADODB.Recordset") with rsNt 'this line uses the constants 'If you don't wanna go find adovbs.asp then you can use this line: '.Open "name_of_your_table", dbconn, 1, 2 .Open "name_of_your_table", dbconn, adOpenKeyset,adLockPessimistic .AddNew 'defining some data .Fields("name_of_a_field") = "a value" .Fields("name_of_another_field") = "another value" .Update NewID = .Fields("name_of_your_autoincrement_field") end with 'closing the connection dbConn.close %>
© 1999-2004 Synop Pty Ltd