Okay I'm new to ASP...use to doing PHP but my client has an asp only server.... I've create an Access 97 db called CTCLCDb.mdb and I'm working with a table called Users.
I'm trying to insert information into the table
Here is the code - I have it in a Procedure
Sub AddingUser
'Declare Variables for form data and asssign values
Dim strName, strLogin, strPassword, strType
strName = Request.Form("Name"
strLogin = Request.Form("Login"
strPassword = Request.Form("Password"
strType = Request.Form("Type"
Response.Write "Login entered "
Response.Write strLogin
Response.Write " Password Entered "
Response.Write strPassword
Response.Write " Type selected "
Response.Write strType
'Take the password and encrypt it with the global key and function defined in header
Response.Write " <BR> The encryption key "
Response.Write strEncryptKey
Dim varEncryptedPassword, varDecryptedPassword
varEncryptedPassword = EncodeKey(strPassword,strEncryptKey)
Response.Write "<BR> the encrypted password is "
Response.Write varEncryptedPassword
varDecryptedPassword = DecodeKey(varEncryptedPassword,strEncryptKey)
Response.Write "<BR> the decrypted password is "
Response.Write varDecryptedPassword
'Take the variables and insert them into the users table
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection"
'Set an active connection to the Connection object using a DSN-less connection
strConnectionString="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("../database/CTCLCDb.mdb"
adoCon.Open strConnectionString
'SQL String
strSQL = "INSERT INTO Users(Name,LoginName,Password,Type)" & _ " VALUES('" & strName &
"' , '"& _ strLogin &"', '" &_ varEncryptedPassword & "', '" &_ strType & "')"
'Execute SQL
adoCon.Execute strSQL
'Close connections
adoCon.Close
set adoCon = Nothing
'Statement saying user has been added
Response.Write "<p> <STRONG>User "
Response.Write strName
Response.Write " has been added to the table. </STRONG></p>"
End Sub
Here is the error I'm getting
Microsoft VBScript compilation error '800a0408'
Invalid character
/4Final/CTAdminTool/usersDetail.asp, line 48
strSQL = "INSERT INTO Users(Name,LoginName,Password,Type)" & _ " VALUES('" & strName & "' , '"& _ strLogin &"', '" &_ varEncryptedPassword & "', '" &_ strType & "')"
---------------------------------------------------------------^
The ^ is pointing under the V in VALUES
Here is the website if you want to see the error better
Any help is most appreciated... I'm going crazy trying to figure this mess out.
Happy New Years!
Maranda
I'm trying to insert information into the table
Here is the code - I have it in a Procedure
Sub AddingUser
'Declare Variables for form data and asssign values
Dim strName, strLogin, strPassword, strType
strName = Request.Form("Name"
strLogin = Request.Form("Login"
strPassword = Request.Form("Password"
strType = Request.Form("Type"
Response.Write "Login entered "
Response.Write strLogin
Response.Write " Password Entered "
Response.Write strPassword
Response.Write " Type selected "
Response.Write strType
'Take the password and encrypt it with the global key and function defined in header
Response.Write " <BR> The encryption key "
Response.Write strEncryptKey
Dim varEncryptedPassword, varDecryptedPassword
varEncryptedPassword = EncodeKey(strPassword,strEncryptKey)
Response.Write "<BR> the encrypted password is "
Response.Write varEncryptedPassword
varDecryptedPassword = DecodeKey(varEncryptedPassword,strEncryptKey)
Response.Write "<BR> the decrypted password is "
Response.Write varDecryptedPassword
'Take the variables and insert them into the users table
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection"
'Set an active connection to the Connection object using a DSN-less connection
strConnectionString="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("../database/CTCLCDb.mdb"
adoCon.Open strConnectionString
'SQL String
strSQL = "INSERT INTO Users(Name,LoginName,Password,Type)" & _ " VALUES('" & strName &
"' , '"& _ strLogin &"', '" &_ varEncryptedPassword & "', '" &_ strType & "')"
'Execute SQL
adoCon.Execute strSQL
'Close connections
adoCon.Close
set adoCon = Nothing
'Statement saying user has been added
Response.Write "<p> <STRONG>User "
Response.Write strName
Response.Write " has been added to the table. </STRONG></p>"
End Sub
Here is the error I'm getting
Microsoft VBScript compilation error '800a0408'
Invalid character
/4Final/CTAdminTool/usersDetail.asp, line 48
strSQL = "INSERT INTO Users(Name,LoginName,Password,Type)" & _ " VALUES('" & strName & "' , '"& _ strLogin &"', '" &_ varEncryptedPassword & "', '" &_ strType & "')"
---------------------------------------------------------------^
The ^ is pointing under the V in VALUES
Here is the website if you want to see the error better
Any help is most appreciated... I'm going crazy trying to figure this mess out.
Happy New Years!
Maranda