L
LeftyLeo via AccessMonster.com
Hello all,
I have searched with no luck for info on an Invalid Object runtime issue, so
am posting a new thread. Can anyone give me some insight on what could be
the problem with my SQL statement? I am getting a -2147217865 run time error,
Invalid object name 'StoreEntryData'. This name is a correct table name,
though it is not a linked sql table as with dbo.tblMasterTable. Any help
would be greatly appreciated!
Set cnn = New ADODB.Connection
With cnn
.Provider = "Microsoft.Access.OLEDB.10.0"
.Properties("Data Provider").Value = "SQLOLEDB"
.Properties("Data Source").Value = "N701SQL16"
.Properties("Initial Catalog").Value = "Sql db name"
.Properties("User Id").Value = "db Id"
.Properties("Password").Value = "db pw"
.Open
End With
Set rec = New ADODB.Recordset
rec.Open "INSERT INTO dbo.tblMasterTable ( fldDate, fldLocation,
fldPeriod, fldYear, [Beginning Balance], fldOrganization, fldAddress, fldCity,
fldState, fldZip, fldDescription, [Req Letter on File], [501 (c) 3 Number],
[Focus Area], [Donation Description], fldAmount, fldZone )" & _
"SELECT StoreDataEntry.Date, StoreDataEntry.Location, StoreDataEntry.
Period,StoreDataEntry.[Year], StoreDataEntry.[Beginning Balance],
StoreDataEntry.Organization, StoreDataEntry.Address, StoreDataEntry.City,
StoreDataEntry.State, StoreDataEntry.Zip, " & _
"StoreDataEntry.Description, StoreDataEntry.[Req Letter on File],
StoreDataEntry.[501 (c) 3 Number], StoreDataEntry.[Focus Area],
StoreDataEntry.[Donation Description], StoreDataEntry.Amount, tblLocation.
fldZone FROM StoreDataEntry INNER JOIN tblLocation ON StoreDataEntry.Location
= tblLocation.fldLocation;", cnn, adOpenDynamic, adLockBatchOptimistic
rec.Close
I have searched with no luck for info on an Invalid Object runtime issue, so
am posting a new thread. Can anyone give me some insight on what could be
the problem with my SQL statement? I am getting a -2147217865 run time error,
Invalid object name 'StoreEntryData'. This name is a correct table name,
though it is not a linked sql table as with dbo.tblMasterTable. Any help
would be greatly appreciated!
Set cnn = New ADODB.Connection
With cnn
.Provider = "Microsoft.Access.OLEDB.10.0"
.Properties("Data Provider").Value = "SQLOLEDB"
.Properties("Data Source").Value = "N701SQL16"
.Properties("Initial Catalog").Value = "Sql db name"
.Properties("User Id").Value = "db Id"
.Properties("Password").Value = "db pw"
.Open
End With
Set rec = New ADODB.Recordset
rec.Open "INSERT INTO dbo.tblMasterTable ( fldDate, fldLocation,
fldPeriod, fldYear, [Beginning Balance], fldOrganization, fldAddress, fldCity,
fldState, fldZip, fldDescription, [Req Letter on File], [501 (c) 3 Number],
[Focus Area], [Donation Description], fldAmount, fldZone )" & _
"SELECT StoreDataEntry.Date, StoreDataEntry.Location, StoreDataEntry.
Period,StoreDataEntry.[Year], StoreDataEntry.[Beginning Balance],
StoreDataEntry.Organization, StoreDataEntry.Address, StoreDataEntry.City,
StoreDataEntry.State, StoreDataEntry.Zip, " & _
"StoreDataEntry.Description, StoreDataEntry.[Req Letter on File],
StoreDataEntry.[501 (c) 3 Number], StoreDataEntry.[Focus Area],
StoreDataEntry.[Donation Description], StoreDataEntry.Amount, tblLocation.
fldZone FROM StoreDataEntry INNER JOIN tblLocation ON StoreDataEntry.Location
= tblLocation.fldLocation;", cnn, adOpenDynamic, adLockBatchOptimistic
rec.Close