PLEASE HELP! Tables and querys wont export/load and receive error when opening DB

Occasional Visitor

I ended up supporting a 2005 Access database then converted to 2016. I noticed the tables and querys did not export. I set the new references and still get the following error.


attached (input) is the error I receive when opening the database. No table or query are on the database. does the code create them from SQL? do I need to point the DB to SQL.

Public SQLcon As ADODB.Connection = user define type not defined.

My questions:

1. Im running though VPN client - does the Access database on my DT need to point to the SQL database on the server or, does the VBA code handle that.

2. Will the tables and querys load once the code runs? I receive errors when compiling and try to open 

Here is the code when trying to open:

Option Compare Database
Option Explicit

Public dbDMI As Database
Public wspDMI As Workspace
Public SQLcon As ADODB.Connection - this is where it errors out
Public gstrLastPO As String
Public gstrLastSC As String
Public gstrLastINV As String
Public gintLastCBF As Integer
Public gstrLastPayment As String
Public gstrLastReceipt As String
Public gstrDocNoSelected As String

When compiling. It errors out here as well:

Public Function LoadCBFrst(prst As ADODB.Recordset) As Boolean - errors here as well
On Error GoTo HandleErrors:
 mstrDocStatus = "OLD"
 With prst
    mintCBFno = !CBFno
    mlngIDbroker = !IDbroker
    mstrInvoiceNo = !InvoiceNo & ""
    If Not IsNull(!InvoiceDate.Value) Then mdtmInvoiceDate = !InvoiceDate.Value
    mcurInvoiceAmount = !InvoiceAmount
    mcurGSPamount = !GSPamount
    If Not IsNull(!DatePaid.Value) Then mdtmDatePaid = !DatePaid.Value
    mbytCBFstatus = !CBFstatus
    mstrPortEntryNo = !PortEntryNo & ""
    mfCommentYN = !CommentYN
    If Not IsNull(!DateStarted.Value) Then mdtmDateStarted = !DateStarted.Value
    If Not IsNull(!DMIcheckNo.Value) Then mlngDMIcheckNo = !DMIcheckNo.Value
    If Not IsNull(!TermsQB) Then
        mintTermsQB = !TermsQB
        mintTermsQB = 0
    End If

Any help you can provide to help me with this is greatly appreciated. Even if you can answer part of it I can move forward from there.

0 Replies