Results 1 to 4 of 4

Thread: NEW Mysql Server prob to insert query date

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,928

    NEW Mysql Server prob to insert query date

    Code:
    SQL = "INSERT INTO UTENZE ([APRI], [USER] , [A_ORA], [NOMINATIVO]) VALUES (CURDATE(),'" & _
            VETTORE & "',CURTIME(),'" & UTENTE_CORRENTE & "')"    
        CONN.Execute SQL, , adCmdText + adExecuteNoRecords
    have error in image.

    note:
    the last var UTENTE_CORRENTE in this case is blank

    APRI and A_ORA are datetime
    USER and NOMINATIVO are Varchar

    my conn:

    Option Explicit
    Public Function connectMysql(USERNAME As String, PASSWD As String, SERVERIP As String, DB As String, CONN As ADODB.Connection, RS As ADODB.Recordset)

    Set CONN = New ADODB.Connection
    With CONN
    .CommandTimeout = 999999
    .ConnectionTimeout = 999999
    .Mode = adModeReadWrite
    .CursorLocation = adUseClient
    .ConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=" & SERVERIP & ";UID=" & USERNAME & ";PWD=" & PASSWD & ";DATABASE=" & DB & ";" & _
    "OPTION=3"
    .Open
    End With

    End Function
    Sub INIZIO1()

    If CONN Is Nothing Then
    Call connectMysql("root", "sal21", "127.0.0.1", "BT", CONN, RS)
    End If

    End Sub
    Attached Images Attached Images  

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