[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to set Null value in ADO Parameter

Posted on 2002-06-28
3
Medium Priority
?
557 Views
Last Modified: 2012-05-04
Using VB6 and ADO - how do you set a paramater value as Null. The parameter is an input parameter to a stored procedure call?
0
Comment
Question by:mdwyer
[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
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 800 total points
ID: 7116710
Hi mdwyer,

this is from MS Develop Support

Private Sub Command1_Click()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim cmd As New ADODB.Command
Dim pm As ADODB.Parameter

cn.Open "Provider=SQLOLEDB;Data Source=....."
Set cmd.ActiveConnection = cn
cmd.CommandText = "insert into [description] values(?)"
cmd.CommandType = adCmdText

Set pm = cmd.CreateParameter("@value", adBSTR, adParamInput, 50)
pm.Value = Null

cmd.Parameters.Append pm
cmd.Execute
cn.Close

End Sub

HAGD:O)Bruintje
0
 

Author Comment

by:mdwyer
ID: 7116985
Thanks! That worked.
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7117002
glad i could help, thanks for the grade
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 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