473,387 Members | 1,882 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,387 software developers and data experts.

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 1598
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
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>...
6
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...
18
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...
4
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...
0
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....
11
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...
4
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...
3
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...
1
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
jinu1996
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...

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.