Solved

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

Posted on 2006-07-11
13
2,367 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
unknown computers in my LAN 12 100
Access Form - Button Format Issue 13 50
Combo box question 6 55
Opening a PDF or RTF file created from an Access application 3 12
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

738 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