Install MDAC 2.7 Refresh and change the OLE DB drivers for Try using default MDASQL drivers. If the result is correct then there is some problem with OLEDB drivers you are using.
Main Topics
Browse All TopicsHello Experts,
I have a visual basic dll that is executing a query on Sybase System 11 using ADO. If I execute the query in Sybase, or look directly at the table the results are 100% correct. When the data is retrieved into the ADO recordset, any numeric fields have trailing zeroes removed. For example the number 1850 will be returned as 185, 1500 will be returned as 15.
Now just for interest, I tried the same query, and swithed to microsoft RDO drivers. With RDO everything worked correctly. However, switching to RDO is not an option for me at this point.
I have checked the web and found a hit on the microsoft web site that talked about this exact problem. However they indicated it should have been fixed with mdac version 2.5. I am running mdac version 2.7.
I am at a loss as to what else could be causing the problem. This is a very urgent problem as it is affecting a production application. It has been shutdown until this is resolved. Does anyone have a solution for this problem?
Thanks,
wfinn
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
In answer to your comments:
supunr: The database is on a different computer. It is running sybase on a unix machine. I am not using cursors.
Sethi: I tried installing MDAC 2.7 Refresh. No luck. I still get the same result. I am not sure what you mean by using the default MDASQL drivers. How do I do that?
Asif_Saadat: Here is the code I am using. The query really doesn't matter. I will just show you a very simple example that fails.
Private Sub Command1_Click()
Dim strQuery As String
Dim mobjSybaseConnector As libEFTSybase.EFTSybaseConn
Dim madconDB As ADODB.Connection ' Database Connection
Set mobjSybaseConnector = New libEFTSybase.EFTSybaseConn
Set madconDB = mobjSybaseConnector.adconG
strQuery = "SELECT amount from teft"
Dim objCmd As ADODB.Command
Dim objRS As ADODB.Recordset
Set objCmd = New ADODB.Command
With objCmd
Set .ActiveConnection = madconDB
.CommandType = adCmdText
'Input Parameters
.CommandText = strQuery
Set objRS = .Execute
End With
While Not objRS.EOF
objRS.MoveNext
Wend
End Sub
I am reading the values from the Registry. Here is the code that creates the connection:
' get connection variables from the registry
strUserId = objRegistry.ReadDataWithDe
mstrREG_ROOTKEY, _
mstrREG_USERID_KEY, _
mstrREG_DEFAULT_USID)
Set objEnv = New libEnvironment.Environment
strEncryptedPwd = objRegistry.ReadDataWithDe
mstrREG_ROOTKEY, _
mstrREG_PASSWORD_KEY, _
objEnv.Encrypt(mstrREG_DEF
strDriver = objRegistry.ReadDataWithDe
mstrREG_ROOTKEY, _
mstrREG_DRIVER_KEY, _
mstrREG_DEFAULT_DRIVER)
strLibraryName = objRegistry.ReadDataWithDe
mstrREG_ROOTKEY, _
mstrREG_LIBRARY_KEY, _
mstrREG_DEFAULT_LIBRARY)
strOther = objRegistry.ReadDataWithDe
mstrREG_ROOTKEY, _
mstrREG_OTHER_KEY, _
mstrREG_DEFAULT_OTHER)
Set objRegistry = Nothing
' the password in the registry is encrypted so decrypt it
strPassword = objEnv.Decrypt(strEncrypte
Set objEnv = Nothing
Set adconThis = New ADODB.Connection
With adconThis
' build dsnless connection string
.ConnectionString = "Driver=" & strDriver & ";" & _
"UID=" & strUserId & ";" & _
"PWD=" & strPassword & ";" & _
"SRVR=" & strLibraryName & ";" & _
strOther
.Open
End With
Business Accounts
Answer for Membership
by: supunrPosted on 2003-06-11 at 17:16:42ID: 8704384
I am not sure if this is going to work or not. First of all is the Database located in a different computer? If so does it have the latest MDAC installed. May be try using client side cursors instead of server side or otherway around and see if that is going to make any difference.