hi -
i have created a passthrough query and have it automatically connect
to the odbc and then on a separate form, i have the user type in the
date parameters. however when i run the following code on my form, i
receive an error that the odbc connection had failed "ODBC – call
failed. (Error 3146)", even though in the pass-through query i pasted
the properties odbc connect str to the qdf.connect code below. does
anyone know why i have this error message?
thanks in advance, jung.
Private Sub btnLiveWire_Dbl Click(Cancel As Integer)
Dim db As Database, qdf As QueryDef, sqltxt As String
Dim parm1 As String
Set db = DBEngine.Worksp aces(0).Databas es(0)
Set qdf = db.CreateQueryD ef("")
qdf.ReturnsReco rds = False
qdf.Connect = "ODBC;DSN=LiveW ire SQL
Server;Descript ion=LiveWire;UI D=JXMCCA3;DATAB ASE=LiveWire;Ne twork=DBMSSOCN; Trusted_Connect ion=Yes;UseProc ForPrepare=0;An siNPW=No"
parm1 = "Me!MyTextB ox" 'user changes the parameter date
sqltxt = "MyStoredProced ure parm1"
qdf.SQL = sqltxt
qdf.Execute 'error message "ODBC – call failed. (Error 3146)", "
qdf.Close
End Sub 2 11932
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Should be:
sqltxt = "MyStoredProced ure '" & Me!MyTextBox & "'"
This supposes the parameter is a text string. If it is a numeric
value you don't have to include the single-quotes:
sqltxt = "MyStoredProced ure " & Me!MyTextBox
HTH,
MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBP7lvuYechKq OuFEgEQLOeACgmr UGfjW1X8Z8L7Fx0 Vck4dixAT4An0Jn
Jpur3sY0EzY+juu MJaRPL6TN
=9Z5x
-----END PGP SIGNATURE-----
JMCN wrote: hi -
i have created a passthrough query and have it automatically connect to the odbc and then on a separate form, i have the user type in the date parameters. however when i run the following code on my form, i receive an error that the odbc connection had failed "ODBC – call failed. (Error 3146)", even though in the pass-through query i pasted the properties odbc connect str to the qdf.connect code below. does anyone know why i have this error message?
thanks in advance, jung.
Private Sub btnLiveWire_Dbl Click(Cancel As Integer)
Dim db As Database, qdf As QueryDef, sqltxt As String Dim parm1 As String Set db = DBEngine.Worksp aces(0).Databas es(0)
Set qdf = db.CreateQueryD ef("")
qdf.ReturnsReco rds = False
qdf.Connect = "ODBC;DSN=LiveW ire SQL Server;Descript ion=LiveWire;UI D=JXMCCA3;DATAB ASE=LiveWire;Ne twork=DBMSSOCN; Trusted_Connect ion=Yes;UseProc ForPrepare=0;An siNPW=No"
parm1 = "Me!MyTextB ox" 'user changes the parameter date sqltxt = "MyStoredProced ure parm1"
qdf.SQL = sqltxt qdf.Execute 'error message "ODBC – call failed. (Error 3146)", " qdf.Close End Sub
MGFoster <me@privacy.com > wrote in message news:<0d******* **********@news read1.news.pas. earthlink.net>. .. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Should be:
sqltxt = "MyStoredProced ure '" & Me!MyTextBox & "'"
This supposes the parameter is a text string. If it is a numeric value you don't have to include the single-quotes:
sqltxt = "MyStoredProced ure " & Me!MyTextBox
HTH,
thanks again, it helped! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Terry |
last post by:
Hello,
I am designing a form and need to know how to get a Check Box(PASS)to
automatically update when the data in a Text Box (MARK), in the same
form, is >=24.
Using the Event dialogue box for the Check Box, AfterUpdate, I have
tried:
IIf(>=24,True,False)
Also:
IIf(>=24,1,0)
Also:
|
by: Jack MacDonald |
last post by:
This is very strange and disturbing. Last night I opened the FE of my
development version of an A97 database and immediately received a
Windows-level error message titled "msaccess.exe Application Error".
The message body was along the lines of "... instruction 0x6517daaa
referenced memory at 0x00000075" etc. The dialog box has an OK and
Cancel button. OK terminates the Access environment entirely. Cancel
launches a dialog box titled...
|
by: sea |
last post by:
If a runtime installation of Access is created and installed on a
client machine that has a full verion of access, will it still be
possible to view the tables and queries in design view but not the
forms? Thank you very much, Sue
|
by: dhcomcast |
last post by:
We're starting to use Oracle for the back-end instead of a separate
Access .mdb file for the data and everything as gone surprisingly well
so far. We are learning Oracle as we go; Yikes! But we have very
patient DBA's at the main office to answer newbie questions.
Using Access 2002 with linked ODBC tables to Oracle 9 (9i? not sure),
ODBC driver is SQORA32.DLL, verson 9.02.00.00.
My "Error 3167: Record is deleted" comes when I use...
|
by: Lauren Wilson |
last post by:
Hi folks,
we have an Access 2003 app that is running just fine on several
thousand computers all over North America. Recently, on ONE in
particular, we suddenly started see a startup error, something like:
"Unable to load JPEG. Image too large. Try a BMP of GIF format
instead." The JPEG in question is just an image for the Title screen.
The file is 335 KB and is loaded at runtime by VBA code by setting the
form's "Picture"...
| |
by: David |
last post by:
Hi,
I've been using MS Access as a front end to our remote MySQL db for a
long time.
I've just added a facility for clients to select a record to copy along
with all its sub-records.
The initial record copies accross ok, but I seem to be having a spot of
bother getting the sql syntax to work. I keep getting an ODBC error
3146 ?
|
by: Yelena Varshal via AccessMonster.com |
last post by:
Hello
We have a shortcut for our MS ACCESS application that uses a /Runtime switch
because we may have some users that use Runtime. The application worked fine
in Access 2000 and was tested with 2003 in the spring. Now that we started to
use it with MS ACCESS 2003 (Full version) we are getting the error on the
last form close when exiting the application. We don't have this error if
deleting /Runtime switch from the shortcut.. The error...
|
by: EManning |
last post by:
Using A2003. I'm receiving this error when returning from a
"DoCmd.OpenReport..." statement. I have a tab control with a subform
on every tab. The user selects an item from a combobox at the top of
the main form which refreshes all the subforms. If this DoCmd
statement is not executed, then I don't receive the error. I tried a
"DoCmd.OpenQuery..." instead of a report but get the same error.
I want the user to be able to...
|
by: Tony |
last post by:
I am continuing to develop an Access 2007 application which was
originally converted from Access 2003. In Access 2003 I was able to
disable the Access Close button in the top righthand corner of the
screen. I have been unable to find any way to disable this button in
Access 2007 and subsequently I have been forced to find ways to detect
and handle the situations after the Access Close button has been
clicked.
I have been largely...
|
by: BL3WC |
last post by:
Hi,
I'd created a MDE under Access 2003. It is now under testing stage. Some of the users will use Access 2003 runtime and some will use Access 2007 runtime to run this MDE. I installed the Access 2007 runtime on a test machine and place the MDE in the Desktop for user's initial testing. I did not create a trust area for this MDE in the test machine as well as in my development machine.
When I tested the MDE using /runtime switch in my...
|
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: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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: 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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| | |