ASP, JScript, and Databases

Results 1 to 2 of 2

Thread: ASP, JScript, and Databases

  1. #1
    Join Date
    Dec 1969

    Default ASP, JScript, and Databases

    Ok, I&#039m working on an ASP Webpage that uses Jscript as its&#039 code. I&#039ve gotten my DSNLess connection working so I can make a connection to my database, but when I try opening the recordset I get this error:<BR>"Microsoft JScript compilation error &#039 800a03ec&#039<BR>Expected &#039;&#039<BR>/local/eq_pics2.asp, line 37<BR>pics_tbl.Open SQL, dbcon<BR>--------------^"<BR>pics_tbl is the Recordset I&#039m trying to open. SQL is my SQL string, dbcon is the database connection I made.<BR>I want to basically get all of the records in the database by using the SQL string:<BR>"SELECT * FROM dir_list"<BR><BR>Here is my code:<BR>&#060;!-----START CODE------&#062;<BR>if (Session("data_conn") != "") {<BR> var dbcon = Session("data_conn");<BR> }<BR>else {<BR> var dbcon = new ActiveXObject("ADODB.connection");<BR> var SQL = "SELECT * FROM dir_list";<BR> var pics_tbl;<BR> var thumb_tbl;<BR> var tablename;<BR> dbcon.Mode = 3;<BR> <BR> //DSN-less Connection string to the database<BR> dbcon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\BEAMSSRV1eesupt.bdpublicEE Repository & Webwwwrootlocaleq_pics.mdb;";<BR> <BR> dbcon.Open;<BR> //connected to the database<BR> Session("data_conn") = dbcon;<BR> pics_tbl = new ActiveXObject("ADODB.Recordset");<BR> pics_tbl.Open SQL, dbcon; &#060;-----Here is the line that had the error<BR> pics_tbl.Close;<BR> dbcon.Close;<BR> }<BR>&#060;-------END CODE-------&#062;<BR><BR>Please tell me what looks wrong with the code different in JScript?<BR>I know I am not doing anything with the results from the query, but I am just trying to go one step at a time...since this is my first interaction with a Database using ASP.

  2. #2
    Join Date
    Dec 1969

    Default RE: ASP, JScript, and Databases

    JScript REQUIRES bracketed method calls<BR><BR>, objConn);<BR><BR>j

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts