Hey guys,
I'm just getting into ASP and have finished installing WebWiz SQL. I have everything running correctly, including having the forums generate content on the webpage. One thing I'd like to do is make it so when a user visits the homepage it checks for their webwiz cookie and, if they've logged in, shows if they have new PM's, or if a certain forum category has updated etc...
After searching the forums I figured out how to use the user_code and match it with the WWF cookie the user holds. For some reason though when I execute the following code:
strUserCode = Request.Cookies("WWF")("UID") Response.Write("UserCode: " & strUserCode) 'open database set connCookieTemp = Server.CreateObject("ADODB.Connection") cookieSQL = "Provider=SQLOLEDB;Server=" & strSQLServerName & ";User ID=" & strSQLDBUserName & ";Password=" & strSQLDBPassword & ";Database=" & strSQLDBName & ";" connCookieTemp.Open cookieSQL set rscookietemp = Server.CreateObject("ADODB.Recordset") 'If a cookie exsists on the users system then read in there username from the database If strUserCode <> "" Then Response.Write("Cookies! Yes!") cookieSQL = "SELECT * FROM tblAuthor WHERE User_Code = "&strUserCode set rscookietemp=connCookieTemp.execute(cookieSQL) strShownUsername = rscookietemp("Username") Response.Write("Found Ya!" & strShownUsername) Else Response.Write("No Cookies? Please Log-In") End If |
I get an error telling me "invalid column name" and then the cookie's info. Anyone know why I'm getting a column error when it should be trying to match the user_code?
Thank you all in advance.
Edited by niugiovanni