Results 1 to 5 of 5
  1. #1
    Join Date
    May 2013
    Posts
    30

    Unanswered: Run-time error '3075'

    Hi guys,

    I am currently stuck on this SQL command that seems to giving me no sense of answer..

    The SQL is this:
    INSERT INTO DatabaseBackupHistory(SourceFilePath,SourceDatabas eFileName,BackupFilePath,BackupDatabaseFileName,Ba ckupDatabaseDate,User,Activity) VALUES('" & Forms!Switchboard!CurrentPage!DefineSubForm!txtFil eURL & "','" & Forms!Switchboard!CurrentPage!DefineSubForm!txtfil ename & "','" & Forms!Switchboard!CurrentPage!DefineSubForm!txtFil ePathSave & "','" & Forms!Switchboard!CurrentPage!DefineSubForm!txtSav eFileName & "','" & Now & "','" & Forms!Login!activeuser & "','Back-ups " & Me.txtfilename & " database')"

    The error message is:
    Syntax error (missing operator) in query expression
    "Some source file path\CurrentProject.accdb','CurrentProject.accdb".

    Then I tried fixing/removing the double quotes, but whenever no error is found and the SQL is run by DoCmd.RunSQL the problem then is that it stores exactly the Now method and the activeuser but the rest are not.

    Do anyone have idea what could be the problem? Thanks in advance...

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you may have to escape the back slash.
    check for quote marks in your data stream
    these are just guesses, it may be more useful to post5 the actual SQL that is failing as opposed to the VBA that creates the sql. the reason being that we don't know if the fault is in your sql or the values being picked up in your form

    Personally I prefer to delimit using chr(39) or chr(34) for quote or speech marks when delimiting text.

    EG
    CHR$39 & ", " & CHR$39 & Now
    No pressing need to do so, but I find it easier than trying to look for pairs of quote marks in a mass of speech marks
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2013
    Posts
    30
    I'll try your advice healdem, thanks..

  4. #4
    Join Date
    May 2013
    Posts
    30
    Still working on it...

  5. #5
    Join Date
    May 2013
    Posts
    30
    Well healdem, its working but well the single quote seems to stored together with the SQL when executed by docmd.runsql.. anyway it's truely working...

    THANKS ALOT FOR HELP

Tags for this Thread

Posting Permissions

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