
Updating linked table info in Access 97 database
Hi
I am trying to update an Access 97 database from VB6 (SP4) using the
following code. The linked table is an Excel spreadsheet a new version of
which I need to point to every morning...the file name for the spreadsheet
is based on the date so it changes every day but the sheet name is always
'Point'.
The code executes OK but it does not change the link at all, it is always
the same as it was before the code executed; no errors are produced. I have
checked the contents of all relevant variables in the debgger and all have
appropriate values.
'(Public gconAccess as new ADODB.Connection) declared elsewhere in the app
Dim adxCatPointage As New ADOX.Catalog
Dim adxTblPointage As New ADOX.Table
'open the schema for the data base and update the file name for the linked
Excel sheet containing the days data
'If gconAccess.State = adStateOpen Then
' adxCatPointage.ActiveConnection = gconAccess
' Set adxTblPointage.ParentCatalog = adxCatPointage
' adxTblPointage.Name = "Tmp_Pointage"
' adxTblPointage.Properties("Jet OLEDB:Create Link") = False
' adxTblPointage.Properties("Jet OLEDB:Remote Table Name") = "Point"
' adxTblPointage.Properties("Jet OLEDB:Link Datasource") =
CStr(strPathPoint) 'contains the path\name of the day's XL sheet
' adxTblPointage.Properties("Jet OLEDB:Create Link") = True
'End If
Can anybody out there see the problem with this one?
Cheers
Paul BJ