Why can't zero-length strings be inserted using INSERT INTO SQL?

llyal

Registered User.
Local time
Today, 23:11
Joined
Feb 1, 2000
Messages
72
Why can't zero-length strings be inserted using INSERT INTO SQL?

When I try to insert fields of a new record, and if one of them is a zero-length, the insert fails.

I can insert nulls but not zero-length- very odd! Following is my SQL:

strSQL = "INSERT INTO tblNTLogIgnoredEntries (Server, LogName, Detail02) "
strSQL = strSQL & "VALUES ('" & rsTrimAdd("Server") & "', '" & rsTrimAdd("LogName") & "', "
strSQL = strSQL & "'" & rsTrimAdd("Detail02") & "'"
strSQL = strSQL & ");"

If any of the values is zero-length, the insert will fail. If all other cases (non-zero and null), insert is successful;

What should I do to have success? My workaround is to populate the source table with a single space character for each zero-length field.

Thank you!

--llyal
 
Does the table definition allow zero length strings for the columns in question?
 
Pat,

I think what you mentioned is the problem; when i create the table, I do not changes the table settings.

I will have to learn to do this programically.

Thank You!

--llyal
 

Users who are viewing this thread

Back
Top Bottom