Solved

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

Posted on 2006-07-11
13
2,307 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Explanation of Access VBA code 2 36
Run Time Error 3071 26 36
Operation must use an updatable query 4 24
Problem with syntax with TransferDatabase 3 14
This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

912 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

17 Experts available now in Live!

Get 1:1 Help Now