Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Connection Question

Status
Not open for further replies.

csiwa28

Programmer
Apr 12, 2001
177
If I connect to a database like so.......

Set oConn = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("AMCA.mdb")
oConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
SQL_query = "SELECT * FROM ProductTypes"
Set oRS = oConn.Execute(SQL_query)

do I still need to include commands found in the adovbs.inc like adLockReadOnly, adCmdTable if I want to Delete, Update, or Insert?
 
NO..You just need connection.execute(query)

"Driver={Microsoft Access Driver (*.mdb)}; DBQ="
&

I've never seen this code with those braces{} around the driver.

set OBJdbConnection=Server.createobject("ADODB.connection")
strProvider ="Driver=Microsoft Access Driver (*.mdb); DBQ=" &_
server.mappath("database/b_days_anvsry.mdb") & ";"
OBJdbConnection.open strProvider
 
Well I am able to open up the database and pull records for display, but when I want to delete a record I get an error

"Could not delete from specified tables".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top