Syntax for VB6.0 to access SQL Server 6.5 
Author Message
 Syntax for VB6.0 to access SQL Server 6.5

I have written code in VB4.0 (16bit) to SQLServer 6.5 using a 16bit
ODBC DSN and I have no problem.   I have used the same code for VB6.0
and a 32-bit DSN to SQLServer 6.5 and the update changes 0 records.  I
can take the SQL statement to ISQL and it will perform the update.   Am
I missing anything going from 16-bit VB to 32-bit VB?   I took the same
code to my old VB4.0 16-bit program and it will update the database
with a 16-bit ODBC.   I developed it using Access 97 and am now ready
to put it in production mode on SQL Server, So I know that the code
works.  My problem exists I belive in the ODBC connection or any code
change that VB6.0 requires that worked in VB4.0.   Any help is
appreciated!!!

The following is used to connect from vb6.0  to sql server and open the
database:

    Connect$ = "ODBC;DSN=SWASTE;UID=SQLUSER;PWD=;"
    Set DB = OpenDatabase("", False, False, Connect$)

The following is my updating code to the database:

    sql = "update table set field1 = 'change' where pkeyfield = 234"
    Set MyWorkSpace = Workspaces(0)
    MyWorkSpace.BeginTrans
    DB.Execute SQL, dbFailOnError
    results = DB.RecordsAffected
    If results > 0 Then
        MyWorkSpace.CommitTrans
        dbsuccess = True
    Else
        MyWorkSpace.Rollback
        dbsuccess = False
    End

* Sent from RemarQ http://www.*-*-*.com/ The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Sun, 07 Apr 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Syntax for VB6.0 to access SQL Server 6.5

2. Update problem with VB6 and SQL Server 6.5

3. HELP! SQL Server 6.5/ADO2/VB6 Question

4. SQL Server 6.5 & VB6 ADO

5. VB6: Data Environment & SQL Server 6.5

6. Pessimistic Recordlocks Access --> SQL Server 6.5

7. Access 97 and SQL Server 6.5

8. migration vb3.0: from access 2.0 to sql server 6.5

9. I need, must have program for converting Access DB to SQL server 6.5 Script

10. Access to SQL Server 6.5

11. VBScript Error due to converting databases from Access to SQL Server 6.5

12. Have access to SQL 6.5 from Vb6 Activex Control Install in a client IE

 

 
Powered by phpBB® Forum Software