By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,644 Members | 2,082 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,644 IT Pros & Developers. It's quick & easy.

ODBC--call failed.

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.