Solved

NULL ADO Parameter

Posted on 2002-05-31
6
642 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Accepted Solution

by:
daffyduck14mil earned 50 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 23 hours left to enroll

617 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