Results 1 to 6 of 6

Thread: Error in Insert statement

  1. #1

    Thread Starter
    Fanatic Member eimroda's Avatar
    Join Date
    Jul 2000
    Location
    Philippines
    Posts
    642

    Error in Insert statement

    I used PWS (win98 ) in testing my asp scripts in my pc and everything was going alright. I uploaded my asp scripts to brinkster.com and even before I uploaded them and used IIS, I was getting a SYNTAX ERROR in INSERT statements (sql) when adding a new record to a table which has an autonumber field (I got no problem with tables without an autonumber field). I tried to use the syntax RS.AddNew but the error I got was "Provider does not support this action" (something like that) . I am confused since with PWS, using the same script, everything was fine. Please help me... By the way I am using Microsoft Access fo rmy database.
    On Error GoTo Hell

    Hell:
    Kill Me


    Food For Thought:

    - Do not judge a book... if you're not a judge!


  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Um... post the insert statement...
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    Fanatic Member eimroda's Avatar
    Join Date
    Jul 2000
    Location
    Philippines
    Posts
    642
    OK, tnx for your time, here it is:

    SQLStmt = "INSERT INTO users "
    SQLStmt = SQLStmt & "(UserName, PassWord, Name, Course, School, email, DateRegistered)"
    SQLStmt = SQLStmt & "VALUES('" & vUserName & "','" & vPword1 & "','" & vName & "', '" & vCourse & "', '" & vSchool & "', '" & vEmail & "', '" & vDate & "')"

    Set RS = Connection.Execute(SQLStmt)
    On Error GoTo Hell

    Hell:
    Kill Me


    Food For Thought:

    - Do not judge a book... if you're not a judge!


  4. #4
    New Member
    Join Date
    Feb 2001
    Posts
    12
    With ms access, shouldn't you surroud dates with ## not ' '?, don't know if that's the problem, bu might be worth a try.

  5. #5
    Hyperactive Member Radames's Avatar
    Join Date
    Feb 2001
    Location
    Tech Tropics
    Posts
    360
    Let me see your connection string please
    Top Tip: You can make friends and impress the opposite sex at geeky cocktail parties by saying "DB" instead of database. - Karl Moore

  6. #6

    Thread Starter
    Fanatic Member eimroda's Avatar
    Join Date
    Jul 2000
    Location
    Philippines
    Posts
    642
    ok here it is:

    ConnectStr = "Provider=Microsoft.Jet.OLEDB.4.0;"
    ConnectStr = ConnectStr & "Data Source=" & Server.MapPath("/eimroda/db/data.mdb") & ";"
    With Connection
    .ConnectionTimeout = 15
    .CommandTimeout = 30
    .ConnectionString = ConnectStr
    .Open
    End With
    On Error GoTo Hell

    Hell:
    Kill Me


    Food For Thought:

    - Do not judge a book... if you're not a judge!


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