VB 4.0 and SQL Server problem 
Author Message
 VB 4.0 and SQL Server problem

I hope somebody can HELP me with this strange problem I'm having
with VB4 and SQLServer.  BTW... everything worked AOK with VB3.

The first example accesses the SQL server database directly,
whereas the second example accesses the same SQL server data files
via an Access (MDB) attached files database.  In the first example,
I can execute DELETE FROM but I am unable to INSERT INTO.  In the
second example, I am unable to DELETE FROM but I can execute an
INSERT INTO.  This problem has me stumped, did MS change the rules?

'FIRST EXAMPLE
'=============
        Set dbSQL = OpenDatabase("", False, False, "ODBC;DSN=x;UID=xx;PWD=xxx")
'This works OK...
        dbSQL.Execute "DELETE FROM x.xx.invoice", dbSQLPassThrough
'This does NOT work...
        sSQL = "INSERT INTO x.xx.invoice "
        sSQL = sSQL + sStuffNotShown + "VALUES (" + sMoreStuffNotShown + ")"
        dbSQL.Execute sSQL, dbSQLPassThrough

'SECOND EXAMPLE
'==============
        Set dbMDB = OpenDatabase("Attach.MDB", True, False)
'This does NOT work...
        dbMDB.Execute "DELETE FROM invoice", dbFailOnError
'This works OK...
        sSQL = "INSERT INTO invoice "
        sSQL = sSQL + sStuffNotShown + "VALUES (" + sMoreStuffNotShown + ")"
        dbMDB.Execute sSQL, dbFailOnError

Tried everything to no avail. If anyone can HELP... thanks in advance!!!




Sat, 04 Apr 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. VB Sql Server Via ADO Problem: [Microsoft][ODBC Sql Server Driver]

2. LONDON - VB 5.0/Sql-Server 6.5/ NT 4.0 - Developers - Derivatives Trading Systems

3. About to try SQL Server qith VB 4.0

4. Record Locking - VB 4.0 / SQL Server 6.0

5. SQL Server & VB 3.0 or 4.0

6. V.B. 4.0 16 bit/ ODBC for SQL Server

7. VB 4.0 DAO with SQL Server

8. WWW Server with VB 4.0, OLE, SQL, Access, ODBC intefaces

9. SQL Server and VB 4.0 Enterprise

10. VB 4.0 and SQL Server

11. VB 4.0 and SQL Server Implementation

12. Deleting from SQL Server via vb 4.0

 

 
Powered by phpBB® Forum Software