Solved

run time error 3275 Unexpected error from external database driver 10019.

Posted on 2006-07-11
13
2,284 Views
Last Modified: 2007-12-19
Hi experts,
I am running a module that used to creat a table for me, and now is creating a problem.
I wrote this in access 2000, and havd 2003 now.  What is wrong?

Function Posting_Types()

Dim db As Database
Dim tb As TableDef

Set db = CurrentDb()    ' Deleteing existing  Graph Data if it exists
For Each tb In db.TableDefs
If tb.Name = "POSTING TYPES" Then
DoCmd.DeleteObject acTable, "POSTING TYPES"
Exit For
End If
Next


'busy cursor
Screen.MousePointer = 11



db.Execute "SELECT POSTDAT.DATESTAMP, POSTDAT.POST_CD, POSTDAT.POST_DT, IIf([post_cd]='1',[post_amt],0) AS ins1, IIf([post_cd]='2',[post_amt],0) AS ins2, IIf([post_cd]='3',[post_amt],0) AS ins3, IIf([post_cd]='4',[post_amt],0) AS ins4, IIf([post_cd]='P',[post_amt],0) AS patpay, POSTDAT.POST_AMT, POSTDAT.POST_UNCOL, POSTDAT.POSTINS, PATDATA.PAT_BC, PATDATA.PAT_LC INTO [POSTING TYPES]" _
    & " FROM PATDATA INNER JOIN POSTDAT ON PATDATA.PAT_ACCT = POSTDAT.PAT_ACCT;"



Set db = Nothing

Screen.MousePointer = 1
End Function
0
Comment
Question by:Quadeeb2003
13 Comments
 
LVL 1

Author Comment

by:Quadeeb2003
ID: 17086463
if I take the sql, and put it in a querry, then run it as a simple querry, i can repress the errors and get the data.
0
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 17086528
What errors are you getting ???

ET
0
 
LVL 1

Author Comment

by:Quadeeb2003
ID: 17086688
run time error 3275
Unexpected error from external database driver 10019

it just stops the function and takes me to the debugger.
0
 
LVL 1

Author Comment

by:Quadeeb2003
ID: 17086698
oh sorry the error i get in sql is the
Unexpected error from external database driver 10019
0
 
LVL 8

Expert Comment

by:infolurk
ID: 17087181
If the code is running OK except for the error, you can suppress the error messages with docmd.setwarnings = false.

Function Posting_Types()

Dim db As Database
Dim tb As TableDef

docmd.setwarnings = false

Set db = CurrentDb()    ' Deleteing existing  Graph Data if it exists
For Each tb In db.TableDefs
If tb.Name = "POSTING TYPES" Then
DoCmd.DeleteObject acTable, "POSTING TYPES"
Exit For
End If
Next


'busy cursor
Screen.MousePointer = 11



db.Execute "SELECT POSTDAT.DATESTAMP, POSTDAT.POST_CD, POSTDAT.POST_DT, IIf([post_cd]='1',[post_amt],0) AS ins1, IIf([post_cd]='2',[post_amt],0) AS ins2, IIf([post_cd]='3',[post_amt],0) AS ins3, IIf([post_cd]='4',[post_amt],0) AS ins4, IIf([post_cd]='P',[post_amt],0) AS patpay, POSTDAT.POST_AMT, POSTDAT.POST_UNCOL, POSTDAT.POSTINS, PATDATA.PAT_BC, PATDATA.PAT_LC INTO [POSTING TYPES]" _
    & " FROM PATDATA INNER JOIN POSTDAT ON PATDATA.PAT_ACCT = POSTDAT.PAT_ACCT;"

docmd.setwarnings = true

Set db = Nothing

Screen.MousePointer = 1
End Function
0
 
LVL 1

Author Comment

by:Quadeeb2003
ID: 17087306
I tried your setwarnings code and I got
compile error
argument not optional
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Expert Comment

by:DataMaat
ID: 17089456
I read the question and this is my question?

Why such a difficult solution?

If the table fields don't change, then once make the table "POSTING TYPES" then in code:

docmd.setwarnings false (dont't use =)
docmd.runsql "Delete from POSTING TYPES"

docmd.runsql "INSERT INTO [POSTING TYPES] (DATESTAMP,POST_CD,POST_DT,ins1, etc) " _
                    & " SELECT POSTDAT.DATESTAMP, POSTDAT.POST_CD, POSTDAT.POST_DT, IIf([post_cd]='1',[post_amt],0) AS ins1, IIf([post_cd]='2',[post_amt],0) AS etc.

docmd.setwarnings true

bye

0
 
LVL 39

Expert Comment

by:stevbe
ID: 17090883
ok ... but if the table fields doin't chnage and the SQL doesn't chnage why use code to do anything but to execute saved queries?

'delete old data
CurrentDb.Execute "qdelOldGraphData"

'add new data
CurrentDb.Execute "qappOldGraphData"

0
 
LVL 1

Author Comment

by:Quadeeb2003
ID: 17091691
I tried the docmd.setwarnings true (with no =) and I did not get an error there.
I still received the same run time error though.

As for why I did it that way, I'm just not that good at access, it is not my forte'.

The table and field names do stay the same, the data changes.

I don't follow the
'delete old data
CurrentDb.Execute "qdelOldGraphData"
that stevbe suggests.
0
 
LVL 39

Expert Comment

by:stevbe
ID: 17092343
Make a delete query and save it with a name of qdelOldGraphData
this way you don't need to build a new table everytime in code

Your SQL is static so you might as well save that as a query also so you don't need to write the SQL in code which will alos be much easier to debug.


Function Posting_Types()

    'busy cursor
    Screen.MousePointer = 11

    'clear old data instead of deleting the table itself.
    'if you want the SQL ... DELETE * FROM [POSTING TYPES]

    'add the new data
    'take the SQL you are building in code and make it a real query and then execute the name of the query
    CurrentDB.Execute "qdelNewGraphData"         CurrentDB.Execute "qappNewGraphData"

    'return cursor to normal
    Screen.MousePointer = 1

End Function

0
 
LVL 1

Author Comment

by:Quadeeb2003
ID: 17095415
i created a new querry as sql, from the old querry.
I made it an append querry, (a select querry could not be run from execute)

I still get the same
run time error 3275
Unexpected error from external database driver 10019

The querry can run as a select querry manually. The data from this table is going to populate a report.
0
 
LVL 1

Author Comment

by:Quadeeb2003
ID: 17095449
OK, this is funny (or not if you're me)
I set the report to run directly off of the querry and I get the 10019 error, the other error is not there.
0
 
LVL 39

Accepted Solution

by:
stevbe earned 500 total points
ID: 17098755
I checked out the 10019 error message ...

?AccessError(10019)
SCRATCH can't find the database containing the linked table '|.'@The properties set in SCRATCH for the linked table will be lost.
Do you want to continue with the conversion anyway?@@19@@2

Are both databases the same version?
Have you verified your table links?
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now