20 DIGIT NUMBER

Discussion forum about all things SqlBase.
Clifford Bass

Re: 20 DIGIT NUMBER

Post by Clifford Bass » 21 Jan 2015, 18:08

mvandine wrote:Thanks, Cliff. The reply is greatly appreciated!

Best regards,
Hi Mike,

You are welcome!

It does raise some questions. Is the SQLBaseOLEDB provider passing through the full value through to the .NET OleDb system as a decimal or whatever? Or is it passing it as a rounded double value? If as a double value, could that be changed without breaking something else?

Out of curiosity I did a test with ODBC into Access and get the following:

Code: Select all

X_NUMBER               Expr1
9.87654321098765E+21   9,876,543,210,987,650,000,000
But using ODBCTest I get this:

Get Data All:
"X_NUMBER"
9876543210987654321098
1 row fetched from 1 column.

So it looks like the ODBC driver gets the full value without any troubles. Just that somewhere further down the line Access changes it.

Clifford Bass

Re: 20 DIGIT NUMBER

Post by Clifford Bass » 21 Jan 2015, 18:10

FRBhote wrote:Thank you very much Cliff!
You are welcome Feroz!

Cliff

FRBhote
India
Posts: 2172
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: 20 DIGIT NUMBER

Post by FRBhote » 22 Jan 2015, 06:15

We are working on changing it - we used the OLEDB provider because the same program has to work with Sqlbase, SqlServer and Oracle - deploying was much easier this way.

Clifford Bass

Re: 20 DIGIT NUMBER

Post by Clifford Bass » 22 Jan 2015, 07:10

Hi Feroz,

You can keep most of your code as-is if you use the various base classes: IDbConnection, IDbCommand, IDataReader etc.

You just need to do something like this in various places. Could actually make a class or several functions to do the work so you don't have to each time. This is from some code I did that accessed the database using a variety of types of connections. In retrospect it could have been even more generic; having only one generic connection object instead of three different ones. But it was the first time I had tried that kind of thing, so that is how it ended up. The appropriate connection object was created and opened earlier in a totally different section of code. idbcmd1 was a class-level variable.

Code: Select all

         If idbcmd1 Is Nothing then
            If rbtnODBCCommand.Checked Then
               idbcmd1 = New OdbcCommand
               idbcmd1.Connection = m_odbcConnection
            Else If rbtnOleDbCommand.Checked Then
               idbcmd1 = New OleDbCommand
               idbcmd1.Connection = m_oledbConnection
            Else If rbtnSQLBaseCommand.Checked Then
               idbcmd1 = New SQLBaseCommand
               idbcmd1.Connection = m_sbConnection
            End If
         End If
         idbcmd1.CommandText = cstrSelectFrom & cstrTable1
         drdr1 = idbcmd1.ExecuteReader
         Application.DoEvents
         dtblTheData1.Load(drdr1, LoadOption.OverwriteChanges)
         drdr1.Close
         intRecordsRead1 = dtblTheData1.Rows.Count
         If chkDisposeCommands.Checked Then
            dtblTheData1 = Nothing
            drdr1 = Nothing
            idbcmd1.Dispose
            idbcmd1 = Nothing
         End If
Cliff

FRBhote
India
Posts: 2172
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: 20 DIGIT NUMBER

Post by FRBhote » 23 Jan 2015, 05:56

Actually we do have these connects all over the place and in our newer programs the connections are centralised. Working on it to make it more manageable. Hopefully it should be over by tomorrow.

In the process found quite a few dangling connects without disconnects!

Cheers!

Jsfmllr
Germany
Posts: 66
Joined: 17 Nov 2019, 16:08
Location: Munich

Re: 20 DIGIT NUMBER

Post by Jsfmllr » 20 May 2021, 14:44

Hello You all,

I have the same problem - but with TD 7.1.1
As I didn_t find a solution yet, I made a work-around by using STRING fields/columns and converting to and fro
It would reduce effort, if I habe a solution where I can use NUMBER-type

TIA
Stay healthy in these days.

regards
Sepp

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests