Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Variable values being used as column name by mistake?


Message #1 by "Eoghan O'Byrne" <Eoghan.O'Byrne@W...> on Fri, 29 Jun 2001 15:37:34 +0100
Hi,



On one of my pages which checks if a users information is in the table

before entering in a new row i'm getting this error





Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name

'eoghan'.

/pr_sys/createuser.asp, line 23





This is the code section in the error:



set dbconn =3D Server.CreateObject("ADODB.Connection")

dbconn.Open Application("aplPRConnectionString")



dq =3D Chr(34)



pr_usr =3D LCASE(request.form("pr_username"))

pr_pwd =3D LCASE(request.form("pr_password"))

pr_eml =3D LCASE(request.form("pr_email"))



AccountCheck =3D "SELECT USR.UID FROM PR_USERS USR WHERE USR.UNAME=3D" & 

dq

& pr_usr & dq & " AND USR.UPASSWORD=3D" & dq & pr_pwd & dq & " AND

USR.UEMAIL=3D" & dq & pr_eml & dq & ""



CreateUser =3D "INSERT INTO PR_USERS (UNAME, UPASSWORD, UEMAIL) VALUES 

('"

& pr_usr & "', '" & pr_pwd & "', '" & pr_eml & "')"



set dbcon =3D dbconn.Execute (AccountCheck)



If dbcon("UID") =3D "" then



	dbconn.Execute(CreateUser)





Please help.



Thanks,



Eoghan O'Byrne,

Webmaster,

Web Applications Developer,

Ward Solutions Ltd.

Phone + 353   1 6420100

Desk   + 353   1 6420129

Mobile + 353 87 4145794

Fax     + 353   1 6420110

email   Eoghan.O'Byrne@w...

www.ward.ie






  Return to Index