VB + Oracle (ODBC) = GPF

From: <dmatt.henr801h_at_xerox.com>
Date: Thu, 23 Jun 1994 19:20:50 GMT
Message-ID: <1994Jun23.173556.12228_at_news.wrc.xerox.com>


I am porting a Windows 3.1 Visual Basic project from NT/AS + SQL Server to a  Solaris + Oracle 7.0 setup. The code uses a lot of ExecuteSQL and CreateSnapshot calls, no direct ODBC calls and us written using VB 3.0 Pro.

I can do the ODBC connect to the Oracle database but insert and deletes will cause a GPF. I can attach to a table with access 1.1 and do inserts and deletes with no problem. The code works fine with SQL Server on NT/AS.

Client box is a NCR 3333, 486DX2-66, 16mb ram, WFW3.11, Chameleon NFS 4.0 providing WinSock. Oracle client software is ODBC Driver V1.1.0.0, SQLNet TCP/IP V1.1.7.10, support files V7.0.16.2.0E.

Any suggestions?

Dave Matthews
dmatt.henr801h_at_xerox.com

Sample vb code to demonstrate the problem follows:

Globals:

Dim gDB As database
Dim gConnected As Integer

For the connect/disconnect button:

Sub bConnect_Click ()
  If gConnected = False Then
    startTime.Text = Time$
    Set gDB = OpenDatabase("", False, False, "ODBC;DSN=" & datasource.Text)     gConnected = True
    bConnect.Caption = "Disconnect"

    bInsert.Enabled = True
    bSelect.Enabled = True
    bdelete.Enabled = True

    stopTime.Text = Time$

  Else
    startTime.Text = Time$
    gDB.Close
    gConnected = False
    bConnect.Caption = "Connect"   

    bInsert.Enabled = False
    bSelect.Enabled = False
    bdelete.Enabled = False

    stopTime.Text = Time$
  End If

End Sub

for a delete that causes a GPF:

Sub bDelete_Click ()
  Dim rows As Integer
  Dim sql As String   

  sql = "delete from odbc_test;"
  startTime.Text = Time$
  rows = gDB.ExecuteSQL(sql)
  stopTime.Text = Time$
End Sub

for a Insert that causes a GPF:

Sub bInsert_Click ()
  Dim i As Integer
  Dim sql As String
  Dim rows As Integer
  startTime.Text = Time$

  For i = 1 To Val(insertcount.Text)
    sql = "insert into odbc_test (numeric_col, text_col) values ( "
    sql = sql & Format$(i) & "," & """ this is text """ & ") "
    insertStatement.Text = sql
    rows = gDB.ExecuteSQL(sql)
  Next i
  stopTime.Text = Time$
End Sub Received on Thu Jun 23 1994 - 21:20:50 CEST

Original text of this message