473,662 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Name Parameters - Access

Art
Help!

I'm writing a vb.net application that uses Access as a database. I've got a
bunch of queries that I wrote within Access. I'm running them from VB. Most
of these queries have parameters. I'm adding parameters to an OleDbCommand
using Parameters.Add( name,value). This works fine as long as I add my
parameters in the same order as they exist in the Access query. I changed
"name" to something nonsensical and it still worked as long as the order was
correct. It doesn't seem to be matching the name. Oh, if the order isn't
correct, the vb app crashes.

Could someone tell me what I'm doing wrong?

Art
Nov 21 '05 #1
2 1613
You're doing fine. Just OleDbParameter uses position instead of name. Your
program craches if you changed the order because the data types of the
parameters is different. Try to put three integer parameters and change the
order. I think it will work.
More information:
http://msdn.microsoft.com/library/de...classtopic.asp

and

http://msdn.microsoft.com/library/de...classtopic.asp

You can obviously see that OleDbParameter is different from SqlParameter.

"Art" wrote:
Help!

I'm writing a vb.net application that uses Access as a database. I've got a
bunch of queries that I wrote within Access. I'm running them from VB. Most
of these queries have parameters. I'm adding parameters to an OleDbCommand
using Parameters.Add( name,value). This works fine as long as I add my
parameters in the same order as they exist in the Access query. I changed
"name" to something nonsensical and it still worked as long as the order was
correct. It doesn't seem to be matching the name. Oh, if the order isn't
correct, the vb app crashes.

Could someone tell me what I'm doing wrong?

Art

Nov 21 '05 #2
You're doing fine. Just OleDbParameter uses position instead of name. Your
program craches if you changed the order because the data types of the
parameters is different. Try to put three integer parameters and change the
order. I think it will work.
More information:
http://msdn.microsoft.com/library/de...classtopic.asp

and

http://msdn.microsoft.com/library/de...classtopic.asp

You can obviously see that OleDbParameter is different from SqlParameter.

"Art" wrote:
Help!

I'm writing a vb.net application that uses Access as a database. I've got a
bunch of queries that I wrote within Access. I'm running them from VB. Most
of these queries have parameters. I'm adding parameters to an OleDbCommand
using Parameters.Add( name,value). This works fine as long as I add my
parameters in the same order as they exist in the Access query. I changed
"name" to something nonsensical and it still worked as long as the order was
correct. It doesn't seem to be matching the name. Oh, if the order isn't
correct, the vb app crashes.

Could someone tell me what I'm doing wrong?

Art

Nov 21 '05 #3

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

Similar topics

11
3018
by: Andrew Thompson | last post by:
I have written a few scripts to parse the URL arguments and either list them or allow access to the value of any parameter by name. <http://www.physci.org/test/003url/index.html> <http://www.physci.org/test/003url/index.html?url=http://mybiz.com/&that=this&when=now#21> <http://www.physci.org/test/003url/index.html?url=http://mybiz.com/&when=now> Before I go offering it in public (and writing it into any number of the 'development kits'...
6
6291
by: dharmadam | last post by:
Is it possible to pass a column name or the order of the column name in the DB2 table table function. For example, I want to update the address of a person by passing one of the address column name like ZIP CODE or ADDRESS LINE. I will call the function with three parameter--UpdateAddress(5,zip_code,person_id) where 5 indicates ZIP_CODE is the fifth column in the table. If 4 is passed, it indicates the address line is to be updated. ...
18
1970
by: NickName | last post by:
The following example may further clarify the question, Select fieldA, filedB, fieldC >From tblX Where fieldD = Forms!formName!controlName What I'd like to know is how to determine or get (FieldD) for the above SQL stmt, which is a saved query. Meantime, let me stress, I'm talking about query param(s), not criteria, an example of criteria is as follows: Select fieldA, filedB
4
16974
by: Todd Perkins | last post by:
Hello all, surprisingly enough, this is my first newsgroup post, I usually rely on google. So I hope I have enough info contained. Thank you in advance for any help! Problem: I am getting this error when I try to pull up my edit page to display the current database information in the form, and then edit it on click:
0
762
by: Art | last post by:
Help! I'm writing a vb.net application that uses Access as a database. I've got a bunch of queries that I wrote within Access. I'm running them from VB. Most of these queries have parameters. I'm adding parameters to an OleDbCommand using Parameters.Add(name,value). This works fine as long as I add my parameters in the same order as they exist in the Access query. I changed "name" to something nonsensical and it still worked as...
11
3483
by: Alexander Walker | last post by:
Hello I would like to write a method that allows me to pass a reference to an instance of a class, the name of a property of that class and a value to set that property to, the method would then set the property of the instance to the value here is an example of what the method might look like public void SetProperty(object instance, string property, object value) {
4
3622
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if possible.. for example..i hav a menu in the parent form named "Administrator" whic has an item "mnuLogIn"..now when i click on login..another child form named "frmLogIn" is displayed..what i want to happen is this: when login form(frmLogIn) is...
3
11686
by: jparulan | last post by:
Hi All, I'm using SOAP3.0. I was able to successfully call a WSDL file and get a value properly. But when the WSDL changed to have a MULTIPLE <element name> it was failing. This code works BEFORE: strCurrency = oSOAP.eServeSearch(CSTR(Request.Form("T1"))) until the WSDL file changed to have more <element name> T1 is just a field that accepts a STRING
1
2501
by: John Kotuby | last post by:
Hi all, I am working on porting an application from VB6 to VB.NET 2003 and am running into some problems. When declaring and populating the parameters for a SQL Stored Procedure by using the SQLParameter() collection and trying to reference a particular parameter by name rather than index I get a Type Conversion error. But when declaring a SqlClient.SqlCommand object and then adding the parameters to the command object parameters...
0
8432
marktang
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...
0
8633
tracyyun
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...
0
7367
agi2029
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...
1
6186
isladogs
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...
0
5654
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();...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
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
2
1993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1752
bsmnconsultancy
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...

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.