strange data control behaviour with DAO 3.6 and SQL server 
Author Message
 strange data control behaviour with DAO 3.6 and SQL server

Hi

I managed a strange behavior of the data control when using DAO 3.6
and  SQL server.
I've a textbox bound to the data control. When i retrieve a recordset
from SQL server and bound this to the data control only the first
letter shows up.
When i fill the textbox directly (textbox1.text = rs!name) everything
is OK! So the recordset is correct.
When using an access database (2000) both methods are ok.
Also when using DAO 3.5 thsi is ok.

Is this a bug of the data control?
DOes someone knows a workaround for this???

Thx Peter



Mon, 21 Nov 2005 20:49:43 GMT  
 strange data control behaviour with DAO 3.6 and SQL server


Wed, 18 Jun 1902 08:00:00 GMT  
 strange data control behaviour with DAO 3.6 and SQL server
here is an sample project
change the sql satement and the connectio to test

the form has 2 textboxes, one i fill and one is filled by the data
control
when referenced to dao 3.51 everything is ok, but a reference to 3.6
shows you only the first character

Option Explicit

    Dim wrkODBC As Workspace
    Dim conPubs As Connection
    Dim rs As Recordset

Private Sub Command1_Click()
    Set rs = conPubs.Openrecordset("select * from kaartnp where naam =
'veen'", dbOpenSnapshot)
    Text1.Text = rs!naam & " " & rs!voornamen
    Set Data1.Recordset = rs
    'text2.text is bound to data1 and to the same fields but show only
the first character when using DAO 3.6
End Sub

Private Sub Command2_Click()
    rs.MoveNext
    Text1.Text = rs!naam & " " & rs!voornamen
End Sub

Private Sub Form_Load()

    Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", "",
dbUseODBC)
    Set conPubs = wrkODBC.OpenConnection("Connection1",
dbDriverNoPrompt, ,
"ODBC;DATABASE=kaartenbak;UID=sa;PWD=;DSN=kaartenbak")

End Sub

On Thu, 05 Jun 2003 14:49:43 +0200, Peter van der Veen

Quote:

>Hi

>I managed a strange behavior of the data control when using DAO 3.6
>and  SQL server.
>I've a textbox bound to the data control. When i retrieve a recordset
>from SQL server and bound this to the data control only the first
>letter shows up.
>When i fill the textbox directly (textbox1.text = rs!name) everything
>is OK! So the recordset is correct.
>When using an access database (2000) both methods are ok.
>Also when using DAO 3.5 thsi is ok.

>Is this a bug of the data control?
>DOes someone knows a workaround for this???

>Thx Peter



Mon, 21 Nov 2005 21:08:23 GMT  
 strange data control behaviour with DAO 3.6 and SQL server
You should use ADO for SQL server database access. DAO is, as far as I know,
suited only for Access.

Regards,
GEORGE IONESCU



Quote:
> here is an sample project
> change the sql satement and the connectio to test

> the form has 2 textboxes, one i fill and one is filled by the data
> control
> when referenced to dao 3.51 everything is ok, but a reference to 3.6
> shows you only the first character

> Option Explicit

>     Dim wrkODBC As Workspace
>     Dim conPubs As Connection
>     Dim rs As Recordset

> Private Sub Command1_Click()
>     Set rs = conPubs.Openrecordset("select * from kaartnp where naam =
> 'veen'", dbOpenSnapshot)
>     Text1.Text = rs!naam & " " & rs!voornamen
>     Set Data1.Recordset = rs
>     'text2.text is bound to data1 and to the same fields but show only
> the first character when using DAO 3.6
> End Sub

> Private Sub Command2_Click()
>     rs.MoveNext
>     Text1.Text = rs!naam & " " & rs!voornamen
> End Sub

> Private Sub Form_Load()

>     Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", "",
> dbUseODBC)
>     Set conPubs = wrkODBC.OpenConnection("Connection1",
> dbDriverNoPrompt, ,
> "ODBC;DATABASE=kaartenbak;UID=sa;PWD=;DSN=kaartenbak")

> End Sub

> On Thu, 05 Jun 2003 14:49:43 +0200, Peter van der Veen

> >Hi

> >I managed a strange behavior of the data control when using DAO 3.6
> >and  SQL server.
> >I've a textbox bound to the data control. When i retrieve a recordset
> >from SQL server and bound this to the data control only the first
> >letter shows up.
> >When i fill the textbox directly (textbox1.text = rs!name) everything
> >is OK! So the recordset is correct.
> >When using an access database (2000) both methods are ok.
> >Also when using DAO 3.5 thsi is ok.

> >Is this a bug of the data control?
> >DOes someone knows a workaround for this???

> >Thx Peter



Mon, 21 Nov 2005 21:42:09 GMT  
 strange data control behaviour with DAO 3.6 and SQL server
Of course, but we have a running application which uses dao 3.51 and
SQL server or Access 95 databases. We want to upgrade the access
databases to 2000 using dao 3.6 and we found this behavior of the SQL
server databases.
And rewriting a DAO application of about 60000 lines to ADO is not
done in a week.
So thats not the solution.



Quote:
>You should use ADO for SQL server database access. DAO is, as far as I know,
>suited only for Access.

>Regards,
>GEORGE IONESCU



>> here is an sample project
>> change the sql satement and the connectio to test

>> the form has 2 textboxes, one i fill and one is filled by the data
>> control
>> when referenced to dao 3.51 everything is ok, but a reference to 3.6
>> shows you only the first character

>> Option Explicit

>>     Dim wrkODBC As Workspace
>>     Dim conPubs As Connection
>>     Dim rs As Recordset

>> Private Sub Command1_Click()
>>     Set rs = conPubs.Openrecordset("select * from kaartnp where naam =
>> 'veen'", dbOpenSnapshot)
>>     Text1.Text = rs!naam & " " & rs!voornamen
>>     Set Data1.Recordset = rs
>>     'text2.text is bound to data1 and to the same fields but show only
>> the first character when using DAO 3.6
>> End Sub

>> Private Sub Command2_Click()
>>     rs.MoveNext
>>     Text1.Text = rs!naam & " " & rs!voornamen
>> End Sub

>> Private Sub Form_Load()

>>     Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", "",
>> dbUseODBC)
>>     Set conPubs = wrkODBC.OpenConnection("Connection1",
>> dbDriverNoPrompt, ,
>> "ODBC;DATABASE=kaartenbak;UID=sa;PWD=;DSN=kaartenbak")

>> End Sub

>> On Thu, 05 Jun 2003 14:49:43 +0200, Peter van der Veen

>> >Hi

>> >I managed a strange behavior of the data control when using DAO 3.6
>> >and  SQL server.
>> >I've a textbox bound to the data control. When i retrieve a recordset
>> >from SQL server and bound this to the data control only the first
>> >letter shows up.
>> >When i fill the textbox directly (textbox1.text = rs!name) everything
>> >is OK! So the recordset is correct.
>> >When using an access database (2000) both methods are ok.
>> >Also when using DAO 3.5 thsi is ok.

>> >Is this a bug of the data control?
>> >DOes someone knows a workaround for this???

>> >Thx Peter



Mon, 21 Nov 2005 21:55:03 GMT  
 strange data control behaviour with DAO 3.6 and SQL server
So you have a working program that was doing fine using DAO 3.51 and
connecting to SQL/Access 95 database and now when using DAO 3.6 and
SQL/Access 200 databases, you see this?

Unfortunately, I sorta have to agree with George on the analysis. What I
think you need to come to terms with is that trying to take advantage of new
technology (i.e. a DAO upgrade and database upgrade) is a serious
undertaking, and refusing to realize that you may need to re-write code is
like trying to fit a square peg in a round hole.

And as far as rewriting DAO to ADO, no biggie really, specially in a small
60k line program, unless the code is so dirty no one can make sense of it.
:p



Quote:
> Of course, but we have a running application which uses dao 3.51 and
> SQL server or Access 95 databases. We want to upgrade the access
> databases to 2000 using dao 3.6 and we found this behavior of the SQL
> server databases.
> And rewriting a DAO application of about 60000 lines to ADO is not
> done in a week.
> So thats not the solution.



> >You should use ADO for SQL server database access. DAO is, as far as I
know,
> >suited only for Access.

> >Regards,
> >GEORGE IONESCU



> >> here is an sample project
> >> change the sql satement and the connectio to test

> >> the form has 2 textboxes, one i fill and one is filled by the data
> >> control
> >> when referenced to dao 3.51 everything is ok, but a reference to 3.6
> >> shows you only the first character

> >> Option Explicit

> >>     Dim wrkODBC As Workspace
> >>     Dim conPubs As Connection
> >>     Dim rs As Recordset

> >> Private Sub Command1_Click()
> >>     Set rs = conPubs.Openrecordset("select * from kaartnp where naam =
> >> 'veen'", dbOpenSnapshot)
> >>     Text1.Text = rs!naam & " " & rs!voornamen
> >>     Set Data1.Recordset = rs
> >>     'text2.text is bound to data1 and to the same fields but show only
> >> the first character when using DAO 3.6
> >> End Sub

> >> Private Sub Command2_Click()
> >>     rs.MoveNext
> >>     Text1.Text = rs!naam & " " & rs!voornamen
> >> End Sub

> >> Private Sub Form_Load()

> >>     Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", "",
> >> dbUseODBC)
> >>     Set conPubs = wrkODBC.OpenConnection("Connection1",
> >> dbDriverNoPrompt, ,
> >> "ODBC;DATABASE=kaartenbak;UID=sa;PWD=;DSN=kaartenbak")

> >> End Sub

> >> On Thu, 05 Jun 2003 14:49:43 +0200, Peter van der Veen

> >> >Hi

> >> >I managed a strange behavior of the data control when using DAO 3.6
> >> >and  SQL server.
> >> >I've a textbox bound to the data control. When i retrieve a recordset
> >> >from SQL server and bound this to the data control only the first
> >> >letter shows up.
> >> >When i fill the textbox directly (textbox1.text = rs!name) everything
> >> >is OK! So the recordset is correct.
> >> >When using an access database (2000) both methods are ok.
> >> >Also when using DAO 3.5 thsi is ok.

> >> >Is this a bug of the data control?
> >> >DOes someone knows a workaround for this???

> >> >Thx Peter



Tue, 22 Nov 2005 00:09:44 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. DAO 3.6 and Sql Server

2. DAO 3.6 and Sql Server

3. DAO 3.6 and data controls

4. DAO 3.6 DAta Control wont refresh

5. Data Controls and DAO 3.6

6. DAO 3.6 and Data Controls - Class not registered

7. strange problem with dao 3.6

8. creating relationships in SQL DDL, DAO 3.6

9. 3259 - Invalid Field data type with DAO 3.6 in VB

10. Moving from DAO 3.5 to DAO 3.6

11. Convert DAO 3.5 to DAO 3.6 Jet Engine 4.0

12. DAO 3.6 vs DAO 3.5 (VB6.0 sp3)

 

 
Powered by phpBB® Forum Software