Insert into db error
Hi,
I have the following code which connects to access database
It is very interesting when I user server.mappath I get no error
but when I use the pgysical path to the db like this
Conn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\mydb.mdb") & ";"
I get insert into sql statement error
and when I try to update with sql statement I get the same error
How is that??
set Conn=server.createobject("Adodb.connection")
Conn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\myDB.mdb") & ";"
Conn.open
sql = "INSERT INTO cards (catID,subID,type,thumbnail,image,name,keyword,act ive,free)"
sql= sql & " VALUES ('"
sql=sql & intCategory & "', '"
sql=sql & "0" & "', '"
sql=sql & strCardType & "', '"
sql=sql & strThumb & "', '"
sql=sql & strImage & "', '"
sql=sql & strCardName & "', '"
sql=sql & strKeyword & "', '"
sql=sql & blnFree & "', '"
sql=sql & blnActive & "');"
conn.execute(SQL)
|