Results 1 to 2 of 2

Thread: [RESOLVED] asp, vbs, db AAARRRGGGHHHH

  1. #1

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Resolved [RESOLVED] asp, vbs, db AAARRRGGGHHHH

    I'm having a hard time setting up my first ASP/VBS/DB script and need some help.
    I've setup a Win98 virtual PC with PWS and IE6, gone into Control Panel/32bit ODBC/System DNS and set the path the the DB I'm using, installed Jet 4-SP8 for Win9X and installed MDAC 2.8 SP1.

    Here's the code I'm fighting with now.
    vb Code:
    1. Set DB = Server.CreateObject("ADODB.Connection")
    2.     DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & "C:\Inetpub\iissamples\Rowen\xyz\RS.mdb")
    3.     Set RS = Server.CreateObject("ADODB.Recordset")
    4.     RS.Open "SELECT * FROM tblCustomer WHERE Email = " & Request.Form ("EmailAddress"), DB
    5.     If RS.EOF And RS.BOF Then
    6.         RS.AddNew
    7.         RS("Email") = Request.Form ("EmailAddress")
    8.     End If


    I'm getting the error "The operation requested by the application is not supported by the provider." in the RS.AddNew line.

    I tried changing the connection like this:
    vb Code:
    1. RS.Open "SELECT * FROM tblCustomer WHERE Email = " & Request.Form("EmailAddress"), DB, adOpenStatic, adLockOptimistic
    but then I get the error, 'Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.'

    So I tried replaceing adOpenStatic and adLockOptimistic with 3 and 2, respectively, but now I get:
    'Syntax error (missing operator) in query expression 'Email = xyz@yahoo.com'. '

    SO, what the heck does this thing want?!?!?!?!?

  2. #2

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: asp, vbs, db AAARRRGGGHHHH

    Ok, I finaly got it, had to wrap the variable in half quotes and threw in a semi-colon like this:

    vb Code:
    1. RS.Open "SELECT * FROM tblCustomer WHERE Email = '" & Request.Form("EmailAddress") & "';", DB ,3 ,2

Posting Permissions

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



Click Here to Expand Forum to Full Width