Anyone know why this code only works in 32bit and not 16 bit vb 4 
Author Message
 Anyone know why this code only works in 32bit and not 16 bit vb 4

I am connecting to SQL server version 6.5 via ODBC and this code only works
in the 32 bit version. However the second piece of code does work in the 16
bit version.
Any help is much appreciated.

*****************************
Does NOT work in 16 bit
*****************************

db = OpenDatabase("enptydb.mdb")
db.Querydefs.Delete "TEST"
Set qd.CreateQueryDef(Name:="TEST")
qd.Connect = "ODBC;uid=;pwd=;database=MyApps;DSN=SQL65DB;"
qd.SQL = "exec mystoredproc"
qd.ReturnsRecords = true
set rs = qd.OpenRecordset(dbOpenSnapshot)

Do Until rs.EOF
        Debug.Print rs(0), rs(1)
        rs.MoveNext
Loop
rs.close
db.close

and
*****************************
Does NOT work in 16 bit
*****************************

db = OpenDatabase("enptydb.mdb")

Set qd.CreateQueryDef("")
qd.Connect = "ODBC;uid=;pwd=;database=MyApps;DSN=SQL65DB;"
qd.SQL = "exec mystoredproc"
qd.ReturnsRecords = true
set rs = qd.OpenRecordset(dbOpenSnapshot)

Do Until rs.EOF
        Debug.Print rs(0), rs(1)
        rs.MoveNext
Loop
rs.close
db.close

but...
****************************
Does work in 16 bit
***************************
db = OpenDatabase("enptydb.mdb")
db.Querydefs.Delete "TEST"
Set qd.CreateQueryDef("TEST")
qd.Connect = "ODBC;uid=;pwd=;database=MyApps;DSN=SQL65DB;"
qd.SQL = "exec mystoredproc"
qd.ReturnsRecords = True
set rs = qd.OpenRecordset("TEST",dbOpenSnapshot)

Do Until rs.EOF
        Debug.Print rs(0), rs(1)
        rs.MoveNext
Loop

rs.close
db.close



Fri, 19 Mar 1999 03:00:00 GMT  
 Anyone know why this code only works in 32bit and not 16 bit vb 4

Hi,

Could it perhaps be due to the fact that the ODBC source (SQL65DB) has
been setup under the odbcadm32 as opposed to the odbcadm (16 bit).  I.E
you are pointing to a 32 bit odbc driver??

If so, I would suggest that you set up a 16 bit source called perhaps
SQL65DB16Bit, and recode the function that doesn't work under 16 bit to
point to this new DSN and give it a try.

Otherwise, who knows...

Jimi



Sun, 21 Mar 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Query works in 16 bit but not 32 bit

2. Anyone know why this code dont work?

3. Converting 32bit VB programs to 16 bit VB programs

4. Anyone know of a 16 BIT Toolbar control?

5. Help, urgent: compiling 16 bit vb 4 coe to 32 bit vb 4 code

6. Further to VB 4 16 Bit not working - MICROSOFT HELP

7. VB 4 16 Bit Not Working MORE Details

8. VB 4.0 16 Bit not Working

9. Why does this not work - Can anyone send the correct Code

10. CARDS.DLL 16 Bit doesn't work on VB 4.0 32 Bit

11. CARDS.DLL 16 Bit doesn't work on VB 4.0 32 Bit

12. CARDS.DLL 16 Bit doesn't work on VB 4.0 32 Bit

 

 
Powered by phpBB® Forum Software