|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I can't the following INSERT statement to work...
Dim oConn, rs, strSql, filePath filePath = Server.MapPath("cust_users.mdb") Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath strSql = "INSERT INTO users (username, password, fldFName, fldLName) VALUES ('"&txtUsername&"','"&txtPassword&"','"&txtFName&"','"&txtLName&"')" set rs = oConn.Execute(strSql) oConn.close set rs = nothing set oConn = nothing any help would be greatly appreciated... |
|
#2
|
||||
|
||||
|
are you getting any errors?
Try this Code:
Dim oConn, rs, strSql, filePath
filePath = Server.MapPath("cust_users.mdb")
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
strSql = "INSERT INTO users (username, password, fldFName, fldLName) VALUES ('" & txtUsername & "','" & txtPassword & "','" & txtFName & "','" & txtLName & "')"
oConn.Execute(strSql)
oConn.close
set oConn = nothing
|
|
#3
|
|||
|
|||
|
I get an internal server error with both...Am I missing something?
ps, thanks for the quick reply! |
|
#4
|
||||
|
||||
|
In internet explorer turn off "Show Friendly HTTP Errors"
Tools>Internet Options>Advanced Tab>Under Browsing Uncheck the "Show Friendly HTTP Errors" check box. Then post the error message you receive. |
|
#5
|
|||
|
|||
|
Its a 500 error,
HTTP 500 - Internal server error Internet Explorer |
|
#6
|
|||
|
|||
|
sorry, I hadn't done the first part yet....
Microsoft JET Database Engineerror '80040e14' Syntax error in INSERT INTO statement. /customers/do_add_customer.asp, line 32 |
|
#7
|
|||
|
|||
|
I FOUND IT!!! password is a reserved word so I needed delimiters.
Thank you for your help! Taking off the friendly errors has helped out a bunch !m! |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > In need of an INSERT |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|