Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In desperate need of Help with VB6 and Sybase!!!!!!!!!!!!!!!!!!!!!

Status
Not open for further replies.

goldi

Programmer
Mar 21, 2001
31
0
0
US
I think I'm missing something....

I have been coding in VB6 for a couple of years, last year I started using Sybase ASA 7 for my database and I'm becoming very frustrated (no training).

The latest thing has been removing data from fields - specifically date fields. With character fields I have found moving " " to the field will blank it out, but now I have fields that have a space in them and not really blank. I get an error if I try to move nulls or an empty string. With the date fields, I have found that I can move a 0 to it, but that makes it equal 12:00 AM! I want to be able to remove a date and leave the field a null which is how it started out.

Am I missing a reference in my VB project? I'm using ADO 2.6. Is the only way to update these fields through SQL? Entering data for the first time is no problem, it's getting it back out.
 
Dont know about Sybase but SQL server has a similar problem, to overcome it I use soemthing like this.

Code:
update mytable set mydate = null where ......

maybe it works for you.
 
Worked like a charm! Seems silly to HAVE to do it that way, but at least it works.

Thanks
 
Uhh, that's how you set the contents of a column to NULL in ANSI SQL. Always been that way.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top