Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

NULL ADO Parameter

Posted on 2002-05-31
6
Medium Priority
?
646 Views
Last Modified: 2008-02-01
Surely this has been done in the past.

I need to sometimes assign a NULL value to an ADO Parameter for supply to a parameterized query ... which is the best available routine to solve this?

TIA
0
Comment
Question by:santosh_14
6 Comments
 
LVL 3

Accepted Solution

by:
daffyduck14mil earned 200 total points
ID: 7046485
Dim cmCommand as Adodb.command

set cmCommand = new Adodb.command
With cmCommand
  .ActiveConnection = g_cnConnection
  .CommandType = adCmdStoredProc
  .CommandText = "sp_insert_user"
  ' [REDO] Use .Parameters.Append .CreateParameter
  ' if you need more speed.
  .Parameters.Refresh
  ' Either leave this out, and call the command,
  ' or set the value.
  .Parameters("@Username").value = Null
  .Execute
end with

Grtz.©

D.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7047489
I suppose there is no sense in reminding you to close your open questions, is there?  For the record:

Questions Asked 55
Last 10 Grades Given A A A A A A A A A A  
Question Grading Record 48 Answers Graded / 48 Answers Received

Anthony
0
 
LVL 10

Expert Comment

by:smegghead
ID: 7048060
Or, you could just omit the parameter and give the parameter within the SP a default value of null.

This also keeps the definition of the SP more consistant, i.e. So that you can see which parameters are optional.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 3

Expert Comment

by:daffyduck14mil
ID: 7055769
Santosh,

Are you going to attend to this question? Given your record not, but i'll wait a few days...

Grtz.©

D.
0
 

Author Comment

by:santosh_14
ID: 7074989
Checked my old email account today .. thx
0
 
LVL 3

Expert Comment

by:daffyduck14mil
ID: 7074993
Great, hope you have your solution.

Grtz.©

D.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question