C
Cynth
Greetings and thank you!
I am performing a very simple insert into an MS Access DB located on a
Microsoft server hosted by GoDaddy. For the sake of testing, I have
hardcoded the data being inserted (normally comes from a form) - see
error and code sample below.
I am getting a wierd error I can't explain or find anything about. I
have scoured my books and can find nothing on this...and the host will
not help.
Any thoughts? Thank you kindly.
Cynthia-
Here's the error...
-----------------------------------------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
ODBC Microsoft Access Driver - Operation must use an updateable query.
Here's the code......it's blowing up on the EXECUTE stmt at the end.
----------------------------------------------------------------
'*** prep for connection to the DB
adCmdText = 1
sDSNDir = Server.MapPath("../_dsn")
connectstr = "filedsn=" & sDSNDir & "\" & dsn_name
'*** create & open DB connection object
Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.Open connectstr
'*** create SQL insert statement
sSql = "INSERT into registrations
VALUES('firstname','middle','last','F','address1','addr2','myCity','NC','28803','usa','2223334444','5556667777','8889990000','(e-mail address removed)','','indiv','my
family members','yes I can','3');"
'*** create DB command object & execute insert
Set dbCmd = Server.CreateObject("ADODB.Command")
Set dbCmd.ActiveConnection = dbConn
dbCmd.CommandType = adCmdText ' text str not stored proc
dbCmd.CommandText = sSql
dbCmd.Execute
'*** cleanup
Set dbCmd = nothing
dbConn.Close
Set dbConn = nothing
----------------------------------------------------------------
I am performing a very simple insert into an MS Access DB located on a
Microsoft server hosted by GoDaddy. For the sake of testing, I have
hardcoded the data being inserted (normally comes from a form) - see
error and code sample below.
I am getting a wierd error I can't explain or find anything about. I
have scoured my books and can find nothing on this...and the host will
not help.
Any thoughts? Thank you kindly.
Cynthia-
Here's the error...
-----------------------------------------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
ODBC Microsoft Access Driver - Operation must use an updateable query.
Here's the code......it's blowing up on the EXECUTE stmt at the end.
----------------------------------------------------------------
'*** prep for connection to the DB
adCmdText = 1
sDSNDir = Server.MapPath("../_dsn")
connectstr = "filedsn=" & sDSNDir & "\" & dsn_name
'*** create & open DB connection object
Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.Open connectstr
'*** create SQL insert statement
sSql = "INSERT into registrations
VALUES('firstname','middle','last','F','address1','addr2','myCity','NC','28803','usa','2223334444','5556667777','8889990000','(e-mail address removed)','','indiv','my
family members','yes I can','3');"
'*** create DB command object & execute insert
Set dbCmd = Server.CreateObject("ADODB.Command")
Set dbCmd.ActiveConnection = dbConn
dbCmd.CommandType = adCmdText ' text str not stored proc
dbCmd.CommandText = sSql
dbCmd.Execute
'*** cleanup
Set dbCmd = nothing
dbConn.Close
Set dbConn = nothing
----------------------------------------------------------------