OK,
I think this is what you are looking for.
everything works until it gets to the T_Player Database.
Attribute VB_Name = "odbc"
Option Compare Database
Option Explicit
'------------------------------------------------------------
' test_odbc1
'
'------------------------------------------------------------
Function odbc()
'On Error Resume Next
Dim LocalDB As Database
Dim localpub As Connection
Dim wrkODBC As Workspace
Dim conPubs As Connection
Dim conLoop As Connection
Dim prpLoop As Property
Dim start As Variant
Dim msg As String
Dim brian As Integer
Dim showsettings As String
Dim allowsettings As String
Dim executeFinalRatings As Boolean
Set LocalDB = CurrentDb()
'Forms!F_ProgressBox!TopTitle.Caption = "Connecting to Web"
'Forms!F_ProgressBox!BottomTitle.Caption = "Connecting to Web"
Forms!F_ProgressBox!FileLabel.Caption = "File:
Forms!F_ProgressBox!ZoneLabel.Caption = "Zone: ALL"
Forms!F_ProgressBox!Statuslabel.Caption = "Status: Updating Server"
Forms!F_ProgressBox.Repaint
On Error GoTo test_odbc1_Err
start = Time()
' Create ODBCDirect Workspace object and open Connection
' objects.
Set wrkODBC = CreateWorkspace("NewODBCWorkspace", _
"admin", "", dbUseODBC)
Set conPubs = wrkODBC.OpenConnection("Connection1", , , _
"ODBC;UID=update;PWD=update9;DSN=DartNet")
'Forms!F_ProgressBox!TopTitle.Caption = "Block Web Site"
'Forms!F_ProgressBox!BottomTitle.Caption = "Block Web Site"
' Forms!F_ProgressBox!Statuslabel.Caption = "Status: Connect"
Forms!F_ProgressBox!FileLabel.Caption = "All Database Areas"
Forms!F_ProgressBox.Repaint
'conPubs.Execute ("UPDATE T_DartSystem SET Updating = 1")
'Forms!F_ProgressBox!TopTitle.Caption = "Updating Web Site"
'Forms!F_ProgressBox!BottomTitle.Caption = "Updating Web Site"
' If we update the web, we always will update this DB
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Dates"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("delete from T_Dates")
LocalDB.Execute ("INSERT INTO Web_Dates SELECT T_Dates.* FROM T_Dates")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=DartNet;UID=none;PWD=test", acTable, "T_Dates", "T_Dates", False
' Check to see if we need to update the FLIGHTS DB
If Forms!F_ProgressBox!UpdateFlights.Value = True Then
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Flights"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Flights")
' DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=DartNet;UID=broal;PWD=test", acTable, "T_Flights", "T_Flights", False
LocalDB.Execute ("INSERT INTO Web_Flights SELECT T_Flights.* FROM T_Flights")
End If
' Check to see if we need to update the LOCATION DB
If Forms!F_ProgressBox!UpdateLocations.Value = True Then
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Location"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Location")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_Location", "T_Location", False
LocalDB.Execute ("INSERT INTO Web_Location SELECT T_Location.* FROM T_Location")
End If
' Check to see if we need to update the MASTER SCHEDULES DB
If Forms!F_ProgressBox!UpdateMasters.Value = True Then
Forms!F_ProgressBox!FileLabel.Caption = "File: T_MasterSchedule4"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_MasterSchedule4")
' DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_MasterSchedule4", "T_MasterSchedule4", False
LocalDB.Execute ("INSERT INTO Web_MasterSchedule4 SELECT T_MasterSchedule4.* FROM T_MasterSchedule4")
Forms!F_ProgressBox!FileLabel.Caption = "File: T_MasterSchedule4_6"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_MasterSchedule4_6")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_MasterSchedule4_6", "T_MasterSchedule4_6", False
LocalDB.Execute ("INSERT INTO Web_MasterSchedule4_6 SELECT T_MasterSchedule4_6.* FROM T_MasterSchedule4_6")
Forms!F_ProgressBox!FileLabel.Caption = "File: T_MasterSchedule6"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_MasterSchedule6")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_MasterSchedule6", "T_MasterSchedule6", False
LocalDB.Execute ("INSERT INTO Web_MasterSchedule6 SELECT T_MasterSchedule6.* FROM T_MasterSchedule6")
End If
' Check to see if we need to update the OPERATOR DB
If Forms!F_ProgressBox!UpdateOperators.Value = True Then
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Operator"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Operator")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_Operator", "T_Operator", False
LocalDB.Execute ("INSERT INTO Web_Operator SELECT T_Operator.* FROM T_Operator")
End If
' Check to see if we need to update the TEAM SCHEDULES DB
If Forms!F_ProgressBox!UpdateTeamSchedule.Value = True Then
Forms!F_ProgressBox!FileLabel.Caption = "File: T_TeamSchedules"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_TeamSchedules")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_TeamSchedules", "T_TeamSchedules", False
LocalDB.Execute ("INSERT INTO Web_TeamSchedules SELECT T_TeamSchedules.* FROM T_TeamSchedules")
End If
' Check to see if we need to update the WEEKS DB
If Forms!F_ProgressBox!UpdateWeeks.Value = True Then
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Weeks"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Weeks")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_Weeks", "T_Weeks", False
LocalDB.Execute ("INSERT INTO Web_Weeks SELECT T_Weeks.* FROM T_Weeks")
End If
' Check to see if we need to update the ZONE DB
If Forms!F_ProgressBox!UpdateZone.Value = True Then
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Zone"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Zone")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_Zone", "T_Zone", False
LocalDB.Execute ("INSERT INTO Web_Zone SELECT T_Zone.* FROM T_Zone")
End If
' Check to see if we need to update the TEAM DB
If Forms!F_ProgressBox!UpdateTeam.Value = True Then
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Team"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Team")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_Team", "T_Team", False
LocalDB.Execute ("INSERT INTO Web_Team SELECT T_Team.* FROM T_Team")
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Forfeit"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Forfeit")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_Forfeit", "T_Forfeit", False
LocalDB.Execute ("INSERT INTO Web_forfeit SELECT T_Forfeit.* FROM T_Forfeit")
End If
' Check to see if we need to update the PLAYER DB
If Forms!F_ProgressBox!UpdatePlayer.Value = True Then
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Player"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Player")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_Player", "T_Player", False
LocalDB.Execute ("INSERT INTO Web_Player SELECT T_Player.* FROM T_Player")
End If
' Check to see if we need to update the ROSTER DB
If Forms!F_ProgressBox!UpdateRoster.Value = True Then
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Player_Team"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Player_Team")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_Player_Team", "T_Player_Team", False
LocalDB.Execute ("INSERT INTO Web_Player_Team SELECT T_Player_Team.* FROM T_Player_Team")
End If
' Check to see if we need to update the PLAYOFF SCHEDULE DB
If Forms!F_ProgressBox!UpdatePlayoff.Value = True Then
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Playoff"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Playoff")
'DoCmd.TransferDatabase acExport, "ODBC", "ODBC;DSN=League;UID=sa;PWD=", acTable, "T_Playoff", "T_Playoff", False
LocalDB.Execute ("INSERT INTO Web_Playoff SELECT T_Playoff.* FROM T_Playoff")
End If
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Award"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Award")
LocalDB.Execute ("INSERT INTO Web_Award SELECT T_Award.Zone, T_Award.PlayerID, T_Award.TeamID, T_Award.Award FROM T_Award")
conPubs.Execute ("update T_Award set decimalvalue=dbo.HEX2DEC(Award)")
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Marks"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Marks")
LocalDB.Execute ("INSERT INTO Web_Marks SELECT T_MARKS.PlayerID, T_MARKS.PlayerZone, T_MARKS.TeamID, T_MARKS.MARKS, T_MARKS.GAMES FROM T_MARKS")
Forms!F_ProgressBox!FileLabel.Caption = "File: T_Points"
Forms!F_ProgressBox.Repaint
conPubs.Execute ("Delete From T_Points")
LocalDB.Execute ("INSERT INTO Web_Points SELECT T_Points.PlayerID, T_Points.PlayerZone, T_Points.TeamID, T_Points.POINTS, T_Points.GAMES FROM T_Points")
'Forms!F_ProgressBox!TopTitle.Caption = "Disconnect From Web"
'Forms!F_ProgressBox!BottomTitle.Caption = "Disconnect From Web"
Forms!F_ProgressBox!FileLabel.Caption = "Setting System Values"
Forms!F_ProgressBox.Repaint
' Check Web Settings on Form
executeFinalRatings = False
showsettings = ""
allowsettings = ""
If Forms!F_ProgressBox!ShowTeamSchedules.Value = True Then
showsettings = showsettings & "/STS"
End If
If Forms!F_ProgressBox!ShowRollingRatings.Value = True Then
showsettings = showsettings & "/SRR"
End If
If Forms!F_ProgressBox!ShowFinalRatings.Value = True Then
showsettings = showsettings & "/SRF"
executeFinalRatings = True
End If
If Forms!F_ProgressBox!ShowPlayoffSchedule.Value = True Then
showsettings = showsettings & "/SPS"
End If
If Forms!F_ProgressBox!OperatorFinal.Value = True Then
showsettings = showsettings & "/SOF"
executeFinalRatings = True
End If
If executeFinalRatings = True Then
' conPubs.Execute ("exec spu_updateFinalRatingAndStatus")
End If
' Update Dart System with new settings and release the block
msg = "UPDATE T_System SET Updating = 0, ShowOptions='" & showsettings & "'"
conPubs.Execute (msg)
conPubs.Close
wrkODBC.Close
msg = "Started: " & start & vbCr & "End: " & Time()
'brian = MsgBox(msg, vbOKOnly)
test_odbc1_Exit:
Exit Function
test_odbc1_Err:
MsgBox Error$
Resume test_odbc1_Exit
End Function
Thanks for loking at this.