Hi;
I'm creating some javascript code in frontpage so that I can retrieve some info from an MS Access database. The database has three fields: username,password and stylesheet. I'm trying to retrieve the stylesheet value by
having a user input their username and password in a form. I then create a SQL SELECT statement with the following code:
SQLstr = "SELECT [stylesheet] FROM userinfo WHERE
(([username] = '" + document.user_form.username.value + "') AND
([password] = '" + document.user_form.password.value + "'))";
When problem-free this will be used to access the info from the database via a connection string. When I try to run the form page , I get an error that says "Unterminated string constant line 22 column 51" . Line 22 column 51 is
the character v in value in the second line.
Once the SQL SELECT statement works, I want to use it to retrieve the stylesheet field from the MS Access database like this:
var strConn = "Driver={Microsoft Access Driver
(*.mdb)};DBQ=" + Server.MapPath("users.mdb");
// connection object creation
var dbConn = Server.CreateObject("ADODB.Connection");
// open the connection
dbConn.Open(strConn);
// Execute the query with constructed SQLstr
var rs = dbConn.Execute(SQLstr);
I'm hoping that the variable rs will hold the stylesheet info and I can pass it to the webpage via the url like this:
<a href="nextpage.asp?styles=<% thestylesheetfield %>"
and link it on the next page, e.g.,
<link rel="stylesheet" type="text/css" href="/styles/<%=
request.querystring(styles) %>" media="screen">
I'm little a new to javascript and not used to mixing single and double quotes; I had gotten this code from reading some texts. Any help is greatly appreciated.
I'm creating some javascript code in frontpage so that I can retrieve some info from an MS Access database. The database has three fields: username,password and stylesheet. I'm trying to retrieve the stylesheet value by
having a user input their username and password in a form. I then create a SQL SELECT statement with the following code:
SQLstr = "SELECT [stylesheet] FROM userinfo WHERE
(([username] = '" + document.user_form.username.value + "') AND
([password] = '" + document.user_form.password.value + "'))";
When problem-free this will be used to access the info from the database via a connection string. When I try to run the form page , I get an error that says "Unterminated string constant line 22 column 51" . Line 22 column 51 is
the character v in value in the second line.
Once the SQL SELECT statement works, I want to use it to retrieve the stylesheet field from the MS Access database like this:
var strConn = "Driver={Microsoft Access Driver
(*.mdb)};DBQ=" + Server.MapPath("users.mdb");
// connection object creation
var dbConn = Server.CreateObject("ADODB.Connection");
// open the connection
dbConn.Open(strConn);
// Execute the query with constructed SQLstr
var rs = dbConn.Execute(SQLstr);
I'm hoping that the variable rs will hold the stylesheet info and I can pass it to the webpage via the url like this:
<a href="nextpage.asp?styles=<% thestylesheetfield %>"
and link it on the next page, e.g.,
<link rel="stylesheet" type="text/css" href="/styles/<%=
request.querystring(styles) %>" media="screen">
I'm little a new to javascript and not used to mixing single and double quotes; I had gotten this code from reading some texts. Any help is greatly appreciated.