Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-07-11
13
Medium Priority
?
3,551 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

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.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

824 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