lcscne
12-11-2003, 12:14 PM
OK whats the number one reason why the connection.execute method would cause a "HTTP 500 Internal Server Error"? Ive checked and rechecked my code.
DBPath = "c:\DataStores\Alumni\Alumni.mdb"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&DBPath&";UID=admin;PWD=;"
qrystring = "insert into cminfo (fname, mname, lname, password, email, yog, memo, website, accepted) VALUES ('"
qrystring = qrystring&request.form("fname")&"', '"
qrystring = qrystring&request.form("mname")&"', '"
qrystring = qrystring&request.form("lname")&"', '"
qrystring = qrystring&request.form("password")&"', '"
qrystring = qrystring&request.form("email")&"', "
qrystring = qrystring&request.form("yog")&", '"
qrystring = qrystring&intvar&"', "
qrystring = qrystring&"false);"
Conn.Execute qrystring
response.write(qrystring) yeilds the following which I can copy directly into an Access query and run without error.
insert into cminfo (fname, mname, lname, password, email, yog, memo, website, accepted) VALUES ('Darin', '', 'Marsh', 'password', 'dogbuddy', 1985, 'dom', false);
if I remark the Conn.Execute qrystring line the code runs without error, but it sure would be nice to be able to add records to the db.
DBPath = "c:\DataStores\Alumni\Alumni.mdb"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&DBPath&";UID=admin;PWD=;"
qrystring = "insert into cminfo (fname, mname, lname, password, email, yog, memo, website, accepted) VALUES ('"
qrystring = qrystring&request.form("fname")&"', '"
qrystring = qrystring&request.form("mname")&"', '"
qrystring = qrystring&request.form("lname")&"', '"
qrystring = qrystring&request.form("password")&"', '"
qrystring = qrystring&request.form("email")&"', "
qrystring = qrystring&request.form("yog")&", '"
qrystring = qrystring&intvar&"', "
qrystring = qrystring&"false);"
Conn.Execute qrystring
response.write(qrystring) yeilds the following which I can copy directly into an Access query and run without error.
insert into cminfo (fname, mname, lname, password, email, yog, memo, website, accepted) VALUES ('Darin', '', 'Marsh', 'password', 'dogbuddy', 1985, 'dom', false);
if I remark the Conn.Execute qrystring line the code runs without error, but it sure would be nice to be able to add records to the db.