Solved

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

Posted on 2006-07-11
13
2,359 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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
 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

756 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