I have a form set up that posts to itself (or the same page). I collect the values from the form and do an insert like this. I have debugged and all variables are showing up in the sql.
I keep getting an error like this:
Microsoft OLE DB Provider for SQL Server error '80040e14'
The name 'Midl3362985' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
The error relates to the (ireg) value
I have tried TextIn(ireg,50) and I get this error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'TextIn'
When I try to put single quotes around ireg like this
","' & (ireg) & '","
I get this error:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Line 1: Incorrect syntax near ','.
I am running in circles anyone have any ideas? Thanks.
Code:
pInsertSql = "INSERT INTO [user] ([userlevel], [paid], [regid], [userpaid], [name], [email], [username], [upass]) VALUES (" & (ulev) & "," & (pd) & "," & (ireg) & "," & (up) & "," & (NPname) & "," & (NPemail) & "," & (NPuname) & "," & (NPupass) & "); Select Scope_Identity() id "
Set Irs=Server.CreateObject("ADODB.Recordset")
Irs.open pInsertSql, conn
NewID=Irs("id")
I keep getting an error like this:
Microsoft OLE DB Provider for SQL Server error '80040e14'
The name 'Midl3362985' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
The error relates to the (ireg) value
I have tried TextIn(ireg,50) and I get this error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'TextIn'
When I try to put single quotes around ireg like this
","' & (ireg) & '","
I get this error:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Line 1: Incorrect syntax near ','.
I am running in circles anyone have any ideas? Thanks.