Results 1 to 4 of 4

Thread: why not work...

  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    why not work...

    When i click on INVIA from addform.asp i recive error:
    Tipo di errore:
    Errore di compilazione di Microsoft VBScript (0x800A03EA)
    Errore di sintassi
    /firme02/addrecord.asp, line 18, column 181
    sql = "INSERT INTO Tabella (matricola, nominativo, sportello, grado, mansione, LaData) VALUES ('"& matricola &"', '"&nominativo&"', '"&sportello&"', '"&grado&"', '"&mansione&"', '"&&"', '"& date() &"')
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^


    Tipo di browser:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)

    Pagina:
    POST 109 bytes to /firme02/addrecord.asp

    POST Data:
    matricola=31232&nominativo=fgfdfgfdgfdgdf&sportell o=1313&grado=3+AREA+3+LIV-I&mansione=ADDETTO+CENTRO+CORPOR.

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: why not work...

    It seems that you have a syntax error near the end of the line in question (18):

    ....'"&mansione&"', '"&&"', '"& date() &"')

    Try changing to:
    .... "&mansione&"',"&date() & ")"

    Be sure to NOT include the date (LaData) in quotes (unless you have it set as a string/text field). Also, be sure to close the line with a double-quote so that the sql statement is a complete string and can be evaluated by the execute() method.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: why not work...

    Tks, Mark...
    is correct this:

    sql = "INSERT INTO Tabella (matricola, nominativo, sportello, grado, mansione, LaData) VALUES ('"& matricola &"', '"&nominativo&"', '"&sportello&"', '"&grado&"', "&mansione&"',"&date() & ")"

    because i have this:
    Tipo di errore:
    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Microsoft][Driver ODBC Microsoft Access]Errore generale. Impossibile aprire la chiave 'Temporary (volatile) Jet DSN for process 0xd0 Thread 0xa68 DBC 0x24d2b6c Jet' del Registro di sistema.
    /firme02/AddForm.asp, line 34


    Tipo di browser:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)

    Pagina:
    GET /firme02/AddForm.asp

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: why not work...

    I'm sorry - I don't completely understand the error message since my undestanding of Italian comes mainily from Puccini's Operas...(O mio babbino caro....) <img src=/S/sing.gif border=0 alt=sing width=24 height=20>

    Anyway, it looks like the previous change corrected a syntax problem. The current problem is most likely due to a data issue. I forgot that you were using an Access database for this data - in which case you will need to surround your date with hash/pound signs ("#").

    Try ending the line like this:

    ... mansione & "', <font color=red>#</font color=red>" & date() & "<font color=red>#</font color=red>)"

    If it still does not work, check the form values to make sure they are correct. If all else fails, try writing your own Insert statement and testing it. Then make sure the sql string you are building is correct.

Posting Permissions

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