Hi all. Need help here as I cant see whats wrong...
I have a querydef in Access 2k which execs a stored proc in a SQL
Server 2k db.
I keep getting the following error, and cant stop it for the life of
me:
"Error 3146: ODBC Call Failed"
Now, the stored proc uses @RETURN_VALUE to pass back an integer result
to the calling process (in this case Access), so I am using
ReturnsRecords = true and qdf.openrecords et to run it.
When it runs from Access i get the errors, when i run it from SQL
Query analyaer it runs fine. I have another querydef in another db
that does the same thing and works fine - the only difference is the
OK one does not use GUIDs as parameters. I was wondering (maybe due to
MS Access' dislike of GUIDs) if this could be the problem causing the
ODBC call failed errors, or if there is something else I have missed
..... here is my code:
Dim strItemGUID As String
dim strSourceGUID as string
Dim Qdf As QueryDef
Dim rst As DAO.Recordset
Set Qdf = CurrentDb.Creat eQueryDef("")
Qdf.Connect = CurrentDb.Table Defs(0).Connect 'same as linked tables in
db
Qdf.ReturnsReco rds = True
Qdf.SQL = "RBE_sp_ChangeQ uestionSource '" & strItemGUID & "', '" &
strSourceGUID & "'"
Set rst = Qdf.OpenRecords et()
.... in the last line also tried assigning return to an integer instead
of a recordset, but same errors.
(note that also, - Access hates GUIDs, so you have to refer to them in
their string context as Access cant deal with Byte arrays or something
like that).
In SQL Server, varchar/char > UniqueIdentifie r conversions are
implicit, but I wonder if this does not happen when using a QDF in
Access and feeding strings in for GUIDs??
I need some clarification, help, and ideas on how to get this working.
I DO NOT want to use string params and convert them within the stored
proc (if i can avoid it).
ideas? suggestions? help?
Many thanks in advance
Karl 1 4158
On 29 Sep 2004 15:30:29 -0700, ka*****@hotmail .com (VBSponge) wrote:
Try this:
Qdf.SQL = "RBE_sp_ChangeQ uestionSource '" &
StringFromGUID( strItemGUID) & "', '" &
StringFromGUID( strSourceGUID) & "'"
-Tom. Hi all. Need help here as I cant see whats wrong...
I have a querydef in Access 2k which execs a stored proc in a SQL Server 2k db. I keep getting the following error, and cant stop it for the life of me:
"Error 3146: ODBC Call Failed"
Now, the stored proc uses @RETURN_VALUE to pass back an integer result to the calling process (in this case Access), so I am using ReturnsRecor ds = true and qdf.openrecords et to run it.
When it runs from Access i get the errors, when i run it from SQL Query analyaer it runs fine. I have another querydef in another db that does the same thing and works fine - the only difference is the OK one does not use GUIDs as parameters. I was wondering (maybe due to MS Access' dislike of GUIDs) if this could be the problem causing the ODBC call failed errors, or if there is something else I have missed .... here is my code:
Dim strItemGUID As String dim strSourceGUID as string Dim Qdf As QueryDef Dim rst As DAO.Recordset Set Qdf = CurrentDb.Creat eQueryDef("") Qdf.Connect = CurrentDb.Table Defs(0).Connect 'same as linked tables in db Qdf.ReturnsRec ords = True Qdf.SQL = "RBE_sp_ChangeQ uestionSource '" & strItemGUID & "', '" & strSourceGUI D & "'" Set rst = Qdf.OpenRecords et()
... in the last line also tried assigning return to an integer instead of a recordset, but same errors.
(note that also, - Access hates GUIDs, so you have to refer to them in their string context as Access cant deal with Byte arrays or something like that).
In SQL Server, varchar/char > UniqueIdentifie r conversions are implicit, but I wonder if this does not happen when using a QDF in Access and feeding strings in for GUIDs??
I need some clarification, help, and ideas on how to get this working. I DO NOT want to use string params and convert them within the stored proc (if i can avoid it).
ideas? suggestions? help?
Many thanks in advance Karl This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Abhi |
last post by:
FYI:
This message is for the benefit of MS Access Community. I found that
this prblem has been encounterd by many but there is hardly any place
where a complete solution is posted. So I thought I should give back
to the community by posting our findings.
Thanks you all for all your help till now by posting problems and
their solutions.
~Abhijit
|
by: Jimbo |
last post by:
I have an access 97 database linked to sql server..I click update on a
form
and get an error message:
Run-time error 3146 ODBC call failed
The debugger points to this line:
MyTable.Update
|
by: jason |
last post by:
I have the following code in a C# class library method:
// GUID VERSION
Guid gUserID = new Guid(sUserID);
Guid gAuthorityID = new Guid(AuthorityID);
oCommand.Parameters.Append(
oCommand.CreateParameter("@authorityid",
ADODB.DataTypeEnum.adGUID,
ADODB.ParameterDirectionEnum.adParamInput,
System.Runtime.InteropServices.Marshal.SizeOf(gAuthorityID),
|
by: Mikey G |
last post by:
Hi, I created a simple VB.NET 2003 application through Visual Studio
that connects to a MySQL database and loads a table into a Dataset, and
then displays that table information in a DataGrid on a form for
editing. The table fill works fine, the delete function works fine, but
when I try to update a row, the application fails with the following
error message:
An unhandled exception of type 'System.Data.Odbc.OdbcException' occurred
in...
|
by: Scott M. Lyon |
last post by:
I've got a stored procedure that takes a few parameters as input parameters,
and one output parameter (a uniqueidentifier).
After the stored procedure call, I need to return that output parameter in a
System.Guid object.
Unfortunately, I'm having zero luck doing this.
Public Function BuildExtract(byval ProjectNumber as string, byval ListNumber
| |
by: Scott M. Lyon |
last post by:
I've got a stored procedure that takes a few parameters as input parameters,
and one output parameter (a uniqueidentifier).
After the stored procedure call, I need to return that output parameter in a
System.Guid object.
Unfortunately, I'm having zero luck doing this.
Public Function BuildExtract(byval ProjectNumber as string, byval ListNumber
|
by: hello_2you |
last post by:
Hello,
I have a vb program that connects to odbc to an sqlexpress server. When
i try to write data to the db, i get this message:
Release Error: Script #1 (Ascent Capture Database)
"de oproep is mislukt" is dutch for "Call failed"
It is an on/off problem, sometimes it works perfectly, but when i try
|
by: Ben |
last post by:
Hi!
It has been weeks now that I have been trying to fix an error that I
encounter everytime it gets to the code at runtime:
SQLStmt = "SELECT Sum() As TotalInStock,
Sum( * ) AS TotalCost " & _
"FROM WHERE = '" & ItemNum & "'"
Set InvP = CurDB.OpenRecordset(SQLStmt, DB_OPEN_DYNASET) '
==>it gets the error here
|
by: network-admin |
last post by:
We have Problems with Access query on Oracle 10g Database with ODBC
Connection.
The Query_1 is such as
select *
from xtable
where ycolumn <"S"
Result = ODBC Faild
----------------------------------------------------
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |