Solved

Urgent : Insert Null into Datetime field

Posted on 2002-03-15
5
337 Views
Last Modified: 2008-02-01
Hi All,

How do I insert Null value into datetime field from
my VB Dll.

Thanks and Regards,
Mukesh
0
Comment
Question by:mukeshkm
  • 2
  • 2
5 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6867598
The answer depends on the way you are currently working:
* using SQL statements
* using updatable recordsets
* using stored procedures

Please indicate, maybe including your code that doesn't work.

Cheers
0
 

Author Comment

by:mukeshkm
ID: 6867623
Hello angellll

what Iam looking at is inserting a record using
SQL statement in my VB function. A friend of mine
put this question to me. Sorry I donot have the
source ...

Mukesh
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6867635

sql = "INSERT INTO yourtable (col1, col2, datecol) VALUES ( 1,2, NULL )"

If you have SQL string you want to execute, you give NULL as value (no quotes, no brackets).

CHeers
0
 
LVL 7

Accepted Solution

by:
simonsabin earned 200 total points
ID: 6867983
If you are using a recordset then set the value of the relevant field to vbNull
0
 

Author Comment

by:mukeshkm
ID: 6868042
thanks simonsabin it works

thanks to angelll too

rgds,
mukesh
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now