i was using ms access as my database where my default value for coloum was "" empty string . now i have shifted to sql 2008 where i cannot put empty sting as default value in the same manner as in access i.e "" . here i have to put either '' or " " ie with space within quotes. this value is treated different from "" value. for eg in statement like

if flexgrid.TextMatrix(1, 1)="" then

How can i set empty string in sql so that value is same as access.


Recommended Answers

All 4 Replies

Your problem lies within your database table in Sql. When the database was created, you have selected that a value MUST be added into the field, hence your error. Edit the specific field in the table to accept null strings.

if i accept null string , i get error in vb '"Invalid use of null"

Did you change the field property in your table to accept a null string? If so, did you specify in your code that the string must NOT be null, hence the error.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.