-
Hi,
I dunno what is wrong with this problem. I wrote a simple VB Program accessing to Access 97 database. This problem only happen if i save the table fields with an empty textbox field(I set the fields to Allow Zero Length to True)I use Microsoft Jet for the connection string. Below is my coding..
Set DBConnect = New ADODB.Connection
With DBConnect
.CursorLocation = adUseServer
.ConnectionString = cntstring
.Open
End With
With rsTest
.Open "CompanyProfile", DBConnect, adOpenDynamic, adLockOptimistic
.AddNew
.Fields("cst_City") = Text1.Text
.Fields("cst_State") = Text1.Text
.Update
.Close
End With
When I run through this code, an error will occur displaying "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.". I change the cursor location to adUserClient and everthing works fine! If I don't change my cursorlocation, using adUseServer... i change the coding to ......
.Fields("cst_City") = Text1.Text & ""
.Fields("cst_State") = Text1.Text & ""
It will save the information!! This is really weird.. and making me crazy..
Anyone has any ideas... please advice.
Thanks..
Thomas
[Edited by tomtan on 11-23-2000 at 12:15 AM]
-
-
Hi da_silvy,
> On Error Resume Next?
Well.. it will stop the error from displaying but it will not save the information to database.
-
You did the right thing
Actually, what you did (concatenating "" to your string) is the right thing to do. A zero length string is not the same as an empty field. Allow zerolength makes access allow zero length strings (like "").
-
But I think the problem is related to the Provider. Because I change from Microsoft Jet provider to an ODBC Data Source and it works fine..
Anyone ever have this kinda problems before?
Thanks.