Need help with SQL

Discussion in 'Software' started by NeoNemesis, Nov 4, 2004.

  1. NeoNemesis

    NeoNemesis Moutharrhea

    I'm learning SQL and I keep getting this error message. Even though I copied and pasted this example from a website. Here is the code for a file called persons.asp:

    <%
    DSNStatement = "DRIVER=Microsoft Access Driver (persons.mdb);DBQ="
    DSNStatement = DSNStatement & Server.MapPath("/desmondp/test/highscores.mdb")
    Conn.Open DSNStatement


    INSERT INTO Persons
    VALUES ('Hetland', 'Camilla', 'Hagabakka 24', 'Sandnes')
    %>

    and I keep getting an error:

    Microsoft VBScript compilation error '800a0401'

    Expected end of statement

    INSERT INTO Persons

    Thanks for the help guys...:) I know this is probably incredibly easy, but i can't figure it out...
     
  2. Wookie

    Wookie Sergeant Major

    Dim adoCon 'Holds the Database Connection Object
    Dim rsConsultants 'Holds the recordset for the records in the database
    Dim strSQL 'Holds the SQL query to query the database

    'Create an ADO connection object
    Set adoCon = Server.CreateObject("ADODB.Connection")

    Set rsConsultants = Server.CreateObject("ADODB.Recordset")

    adoCon.Open dsnstatement

    strSQL = " INSERT INTO Persons VALUES ('Hetland', 'Camilla', 'Hagabakka 24', 'Sandnes')"


    rsConsultants.Open strSQL, adoCon


    try something like that
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds