Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Location
    south jersey, usa
    Posts
    53

    Unanswered: sql update query syntax help

    http://www.filecabin.com/up1/1147364396-1.gif


    then



    http://www.filecabin.com/up1/1147364440-11.gif



    Code:
    query = "update table set date='" & srs.fields("docdate") & "', page=" & srs.fields("pagenumber") &_
                    ", near='" & near1 & "\" & drive & irfile & "', image='" & ars.fields("file_name") &_
                    "', notes='Image not Found on Nearline.' where file_name = '" & ars.fields("file_name") & "'" 
            msgbox query
            set fixrs = aconn.execute(query)


    code to open connection
    Code:
    sub accessconn ' open a connection to access db'
      set aconn = CreateObject("ADODB.Connection") 'prep connection'
      set ars = CreateObject("ADODB.Recordset") ' prep recordset'
      set fixrs = CreateObject("ADODB.Recordset") ' prep recordset'  
      aconn.open "DRIVER={Microsoft Access Driver (*.mdb)};" &_ 
                 "DBQ=" & accessfile & ";DefaultDir=;UID=;PWD=;"
    end sub
    im running a vbscript
    "They say Moses split the Red Sea
    I split the blunt and rolled the fat one, I'm deadly"
    -- Tupac 'Blasphemy'

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    And your problem is??? An error perhaps??? Perhaps on your date field??? Perhaps because you're using a reserved word as a column in a table AND have an incompatible format with the date literal???

    Change your column name or qualify the name if the column and put #'S instead of single quotes around your date literal ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Mar 2006
    Location
    south jersey, usa
    Posts
    53
    first screenshot shows the query that's generated and the access table setup.

    the second screenshot is the error message i get.

    date is set as text; YYYYMMDD

    i dont think any reserved words are being used. But ill double check
    "They say Moses split the Red Sea
    I split the blunt and rolled the fat one, I'm deadly"
    -- Tupac 'Blasphemy'

  4. #4
    Join Date
    Mar 2006
    Location
    south jersey, usa
    Posts
    53
    i was using reserved words. i fixed by wrapping with brackets. Thank you for your suggestions.
    "They say Moses split the Red Sea
    I split the blunt and rolled the fat one, I'm deadly"
    -- Tupac 'Blasphemy'

Posting Permissions

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