473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

ODBC--call failed.

Hello,
Can you hale me to define my mistake please?
I am trying to run a SQL Pass – Through Query from Access 2000 and
inside the record set I am trying to loop for a LoginID. I think
that this function should work.
I get an error at this point Set StoredProcRecordSet =
DB.OpenRecordset(StoredProcQryName, DB_OPEN_SNAPSHOT)

The error is this ODBC--call failed.

Please let me know how can I fix this.
Thank you very much.

Tina

Function GetFullReportCCListServer(MyUnit_Name As String)

Dim StoredProcName As String
Dim StoredProcCall As String
Dim StoredProcQryName As String
Dim StoredProcQueryDef As QueryDef
Dim StoredProcRecordSet As Recordset

Dim DB As Database

On Error GoTo HandleErr
Set DB = DBEngine.Workspaces(0).Databases(0)

StoredProcQryName = "qryGetFullReportCCList"
StoredProcCall = "execute sp_GetFullReportCCList '" & MyUnit_Name
& "'"

Set StoredProcQueryDef = DB.QueryDefs(StoredProcQryName)
StoredProcQueryDef.Sql = StoredProcCall

Set StoredProcRecordSet = DB.OpenRecordset(StoredProcQryName,
DB_OPEN_SNAPSHOT)

StoredProcRecordSet.MoveFirst

Do Until StoredProcRecordSet.EOF

GetFullReportCCListServer = GetFullReportCCListServer &
StoredProcRecordSet.Fields("LoginID") & ";"
StoredProcRecordSet.MoveNext

Loop

GetFullReportCCListServer = Left$(GetFullReportCCListServer,
Len(GetFullReportCCListServer) - 1)
ExitHere:

Set StoredProcRecordSet = Nothing

Exit Function
End Function
Nov 12 '05 #1
7 6137
Replace
Dim StoredProcQueryDef As QueryDef
Dim StoredProcRecordSet As Recordset
Dim DB As Database by
Dim StoredProcQueryDef As DAO.QueryDef
Dim StoredProcRecordSet As DAO.Recordset
Dim DB As DAO.Database

Will usually cure the case.
Kindly repost if it doesn't.

Krgrds,
Perry
"tina" <Ti******@hotmail.com> wrote in message
news:69**************************@posting.google.c om... Hello,
Can you hale me to define my mistake please?
I am trying to run a SQL Pass - Through Query from Access 2000 and
inside the record set I am trying to loop for a LoginID. I think
that this function should work.
I get an error at this point Set StoredProcRecordSet =
DB.OpenRecordset(StoredProcQryName, DB_OPEN_SNAPSHOT)

The error is this ODBC--call failed.

Please let me know how can I fix this.
Thank you very much.

Tina

Function GetFullReportCCListServer(MyUnit_Name As String)

Dim StoredProcName As String
Dim StoredProcCall As String
Dim StoredProcQryName As String
Dim StoredProcQueryDef As QueryDef
Dim StoredProcRecordSet As Recordset

Dim DB As Database

On Error GoTo HandleErr
Set DB = DBEngine.Workspaces(0).Databases(0)

StoredProcQryName = "qryGetFullReportCCList"
StoredProcCall = "execute sp_GetFullReportCCList '" & MyUnit_Name
& "'"

Set StoredProcQueryDef = DB.QueryDefs(StoredProcQryName)
StoredProcQueryDef.Sql = StoredProcCall

Set StoredProcRecordSet = DB.OpenRecordset(StoredProcQryName,
DB_OPEN_SNAPSHOT)

StoredProcRecordSet.MoveFirst

Do Until StoredProcRecordSet.EOF

GetFullReportCCListServer = GetFullReportCCListServer &
StoredProcRecordSet.Fields("LoginID") & ";"
StoredProcRecordSet.MoveNext

Loop

GetFullReportCCListServer = Left$(GetFullReportCCListServer,
Len(GetFullReportCCListServer) - 1)
ExitHere:

Set StoredProcRecordSet = Nothing

Exit Function
End Function

Nov 12 '05 #2
If that were the problem, I don't think the error message would say "ODBC call
failed".

On Tue, 27 Jan 2004 19:30:50 +0100, "Perry" <p.****@chello.nl> wrote:
Replace
Dim StoredProcQueryDef As QueryDef
Dim StoredProcRecordSet As Recordset
Dim DB As Database

by
Dim StoredProcQueryDef As DAO.QueryDef
Dim StoredProcRecordSet As DAO.Recordset
Dim DB As DAO.Database

Will usually cure the case.
Kindly repost if it doesn't.

Krgrds,
Perry
"tina" <Ti******@hotmail.com> wrote in message
news:69**************************@posting.google. com...
Hello,
Can you hale me to define my mistake please?
I am trying to run a SQL Pass - Through Query from Access 2000 and
inside the record set I am trying to loop for a LoginID. I think
that this function should work.
I get an error at this point Set StoredProcRecordSet =
DB.OpenRecordset(StoredProcQryName, DB_OPEN_SNAPSHOT)

The error is this ODBC--call failed.

Please let me know how can I fix this.
Thank you very much.

Tina

Function GetFullReportCCListServer(MyUnit_Name As String)

Dim StoredProcName As String
Dim StoredProcCall As String
Dim StoredProcQryName As String
Dim StoredProcQueryDef As QueryDef
Dim StoredProcRecordSet As Recordset

Dim DB As Database

On Error GoTo HandleErr
Set DB = DBEngine.Workspaces(0).Databases(0)

StoredProcQryName = "qryGetFullReportCCList"
StoredProcCall = "execute sp_GetFullReportCCList '" & MyUnit_Name
& "'"

Set StoredProcQueryDef = DB.QueryDefs(StoredProcQryName)
StoredProcQueryDef.Sql = StoredProcCall

Set StoredProcRecordSet = DB.OpenRecordset(StoredProcQryName,
DB_OPEN_SNAPSHOT)

StoredProcRecordSet.MoveFirst

Do Until StoredProcRecordSet.EOF

GetFullReportCCListServer = GetFullReportCCListServer &
StoredProcRecordSet.Fields("LoginID") & ";"
StoredProcRecordSet.MoveNext

Loop

GetFullReportCCListServer = Left$(GetFullReportCCListServer,
Len(GetFullReportCCListServer) - 1)
ExitHere:

Set StoredProcRecordSet = Nothing

Exit Function
End Function


Nov 12 '05 #3
I can't tell you what the cause of error is, but I can tell you how to find
out more about it.

When you use DAO, and an error is returned from the server or from the ODBC
library, a number of errors are generated, but VB gets only the last one which
is the least informative, and always just says "ODBC call failed". The whole
list of errors is stored in the DAO Errors collection, though, so you just
need to look at Errors(0).Description (I think that's right, it might be 1,
not zero) to see the original cause of the error.

On 27 Jan 2004 10:25:31 -0800, Ti******@hotmail.com (tina) wrote:
Hello,
Can you hale me to define my mistake please?
I am trying to run a SQL Pass – Through Query from Access 2000 and
inside the record set I am trying to loop for a LoginID. I think
that this function should work.
I get an error at this point Set StoredProcRecordSet =
DB.OpenRecordset(StoredProcQryName, DB_OPEN_SNAPSHOT)

The error is this ODBC--call failed.

Please let me know how can I fix this.
Thank you very much.

Tina

Function GetFullReportCCListServer(MyUnit_Name As String)

Dim StoredProcName As String
Dim StoredProcCall As String
Dim StoredProcQryName As String
Dim StoredProcQueryDef As QueryDef
Dim StoredProcRecordSet As Recordset

Dim DB As Database

On Error GoTo HandleErr
Set DB = DBEngine.Workspaces(0).Databases(0)

StoredProcQryName = "qryGetFullReportCCList"
StoredProcCall = "execute sp_GetFullReportCCList '" & MyUnit_Name
& "'"

Set StoredProcQueryDef = DB.QueryDefs(StoredProcQryName)
StoredProcQueryDef.Sql = StoredProcCall

Set StoredProcRecordSet = DB.OpenRecordset(StoredProcQryName,
DB_OPEN_SNAPSHOT)

StoredProcRecordSet.MoveFirst

Do Until StoredProcRecordSet.EOF

GetFullReportCCListServer = GetFullReportCCListServer &
StoredProcRecordSet.Fields("LoginID") & ";"
StoredProcRecordSet.MoveNext

Loop

GetFullReportCCListServer = Left$(GetFullReportCCListServer,
Len(GetFullReportCCListServer) - 1)
ExitHere:

Set StoredProcRecordSet = Nothing

Exit Function
End Function


Nov 12 '05 #4
Thanks Perry. Unfortunately that did not work :(

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #5
That did not work :( Any other suggestions? Please!!!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #6
DFS
Tina,

Execute your statement (whatever ends up in variable StoredProcCall) in an
Access pass-thru query and see what kind of error you get.
"tina" <Ti******@hotmail.com> wrote in message
news:69**************************@posting.google.c om...
Hello,
Can you hale me to define my mistake please?
I am trying to run a SQL Pass - Through Query from Access 2000 and
inside the record set I am trying to loop for a LoginID. I think
that this function should work.
I get an error at this point Set StoredProcRecordSet =
DB.OpenRecordset(StoredProcQryName, DB_OPEN_SNAPSHOT)

The error is this ODBC--call failed.

Please let me know how can I fix this.
Thank you very much.

Tina

Function GetFullReportCCListServer(MyUnit_Name As String)

Dim StoredProcName As String
Dim StoredProcCall As String
Dim StoredProcQryName As String
Dim StoredProcQueryDef As QueryDef
Dim StoredProcRecordSet As Recordset

Dim DB As Database

On Error GoTo HandleErr
Set DB = DBEngine.Workspaces(0).Databases(0)

StoredProcQryName = "qryGetFullReportCCList"
StoredProcCall = "execute sp_GetFullReportCCList '" & MyUnit_Name
& "'"

Set StoredProcQueryDef = DB.QueryDefs(StoredProcQryName)
StoredProcQueryDef.Sql = StoredProcCall

Set StoredProcRecordSet = DB.OpenRecordset(StoredProcQryName,
DB_OPEN_SNAPSHOT)

StoredProcRecordSet.MoveFirst

Do Until StoredProcRecordSet.EOF

GetFullReportCCListServer = GetFullReportCCListServer &
StoredProcRecordSet.Fields("LoginID") & ";"
StoredProcRecordSet.MoveNext

Loop

GetFullReportCCListServer = Left$(GetFullReportCCListServer,
Len(GetFullReportCCListServer) - 1)
ExitHere:

Set StoredProcRecordSet = Nothing

Exit Function
End Function

Nov 12 '05 #7
Note that the person who normally posts in this gorup under the name of salad
does not post using an anonymous remailer, so this post is clearly a fake.

On 27 Jan 2004 22:59:18 -0000, Salad <oi*@vinegar.com> wrote:
Tina Kim wrote:
That did not work :( Any other suggestions? Please!!!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

What say you and I chat about this at Cafe Journal in Mannheim
I'll be there as usual on Thurs at 9 am in the corner near the door
next to the coat rack. I have blond hair and will be wearing a red scarf
and black coat. As you can see in this group, I am a skilled Access user.


Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: mo | last post by:
The code I've pasted below is taken directly from Microsoft's site at http://support.microsoft.com/default.aspx?scid=kb;EN-US;308157 As far as I can tell the error is raised on this line: conn...
0
by: Jeff Reed | last post by:
I am experiencing the the problem outlined the below. Unfortunately, I am using WinXP and I not sure if I can apply the solution due to lack of security control Any feed back would be apreciated ...
9
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My...
9
by: Bijoy Naick | last post by:
I've implemented forms authentication and authorization on my application. In my Web.Config, my authorization section looks like this.. <authorization> <allow roles="admin" /> <deny users="*"...
13
by: Adam | last post by:
Trying to get an asp.net 2.0 app running and am receiving this error. I see a bunch of people with this error on the net, but no solution: Works fine on my local machine, deployed to a server it...
6
by: ruben | last post by:
Hi: I'm running a large database on PostgreSQL 7.1.3. 20 days ago the database failed with a threatening and not too descriptive error like: pg_exec() query failed: server closed the...
1
by: Laurent Lequenne | last post by:
Hello There, I just converted a VS 2003 C++ Project into VS 2005. I already made some changes in my headers files, has I had compilations errors with enums declarations. Now everything compiles...
2
by: news | last post by:
I just upgraded to PHP 4.4.2 on my Slackware 10.2 system. And Apache/mySQL/PHP all work great through a browser. No errors. But when I try to run a PHP script through the command line, which I...
2
by: Dennis | last post by:
I'm getting the following problem occasionally...the application will work perfectly well for a period of time and then this pops up. I have tried turning off the default proxy in the...
1
by: kencana | last post by:
Hi all, I was wondering why I always get "failed to open stream: HTTP request failed!" error in either loading a normal or xml file. i don't understand why i can't get the whole result. the result...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.