Hi,
All of this communicating with a database on a webserver stuff is new to me. I have the code fro downlaoding data from the webserver mySQL to my client-based Access down, but now I need to know how to append data from and client-based Access to ta mySQL.
Here is the code I am using to get the data from mySQL:
Public Function fConnect_DocEPW(intID As Long)
Dim rCON As ADODB.Connection
Dim rRST As ADODB.Recordset
Dim strConnect As String
Set rCON = New ADODB.Connection
strConnect = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=myServer;" _
& "DATABASE=DBName;" _
& "USER=userID;" _
& "PASSWORD=pswd;" _
& "OPTION=3"
rCON.Open strConnect
If rCON.State = adStateOpen Then
Set rRST = New ADODB.Recordset
rRST.Open "SELECT ProspectID, GroupType, `Group`, GroupSub, GroupRating, GroupYrs, GroupYrsConfig, " _
& "GroupYrsCode, GroupYrsMgmt, GroupYrsSales, GroupYrsUser, GroupRole, GroupCertified, " _
& "GroupStaff, GroupGoLives " _
& "FROM docepw " _
& "WHERE ProspectID=" & intID & "", rCON
If rRST.EOF Then
MsgBox "There are no records to import for this Candidate..."
Else
Do Until rRST.EOF
CurrentProject.Connection.
Execute "INSERT INTO MainGroup(ProspectID, GroupType, `Group`, " _
& "GroupSub, GroupRating, GroupYrs, GroupYrsConfig, GroupYrsCode, GroupYrsMgmt, GroupYrsSales, " _
& "GroupYrsUser, GroupRole, GroupCertified, GroupStaff, GroupGoLives) " _
& "VALUES (" & rRST("ProspectID") & "," _
& "'" & rRST("GroupType") & "'," _
& "'" & rRST("Group") & "'," _
& "'" & rRST("GroupSub") & "'," _
& "" & rRST("GroupRating") & "," _
& "" & rRST("GroupYrs") & "," _
& "" & rRST("GroupYrsConfig") & "," _
& "" & rRST("GroupYrsCode") & "," _
& "" & rRST("GroupYrsMgmt") & "," _
& "" & rRST("GroupYrsSales") & "," _
& "" & rRST("GroupYrsUser") & "," _
& "'" & rRST("GroupRole") & "'," _
& "" & rRST("GroupCertified") & "," _
& "" & rRST("GroupStaff") & "," _
& "" & rRST("GroupGoLives") & ");"
rRST.MoveNext
Loop
End If
Else
MsgBox "No Connection Detected!"
End If
Set rRST = Nothing
Set rCON = Nothing
End Function
Start Free Trial