[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::odbc_rdb_driver

Title:DEC ODBC Driver
Notice:DEC ODBC Driver V2.0 Now Available
Moderator:SQLSRV::MAVRIS
Created:Tue Dec 29 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1357
Total number of notes:4864

1339.0. "Error binding columns in VB4" by UKVMS3::RVIRR (High cost of ownership...) Fri May 09 1997 11:38

ODBC Driver for Rdb 2.10.11.00 32bit for Windows 95.
Rdb 6.0-05, SQL/Services 6.0, UCX 3.3 and OpenVMS 6.2.

MS Visual Basic v4 gives error:

SL012 {MICROSOFT] [ODBC Cursor Library]HSTMT bindings may not be changed
when cursor is open.

Looking at the driver (level 17) log and client log (level 7) shows no errors.
However, SQLBindCol is passing a 000000 as a lengh of col.

Microsoft say that 0000000 is a valid value to unbind a column (in SQL Server
anyway) and that its a problem with the ODBC Driver.

        Anyone got any ideas, or anything else I should try before I log a bug?

PS Setting driver logging to 16 in odbcrdb.ini causes a GPF!


T.RTitleUserPersonal
Name
DateLines
1339.1Log files?M5::JBALOGHFri May 09 1997 12:1210
    How about posting a log file created by setting logging in the ODBC
    admin? The error you describe is being returned by the driver manager
    and NOT the ODBC driver. This is not likely an Rdb ODBC issue but we
    need to see the logs to be sure. 
    
    I have never seen that particular error before and I have done quite a
    bit of stuff with VB and ODBC. What exactly is the customer doing in
    VB?
    
    john
1339.2UKVMS3::RVIRRHigh cost of ownership...Fri May 09 1997 13:1944
John,
	Thanks, that was fast!  The log files are big, so I've put them in 
UKVMS3::DISK$RDB2:[RVIRR]*.log

The VB code that produces the error is as follows :-

stmt = "select d_drum_in_process_flag from dyd_in_process_drum where
d_drum_no = '" & Trim(RoDIdentity) & "'"

Set rPrep = rOSCARCon.CreatePreparedStatement("", stmt)
Set rRes = rPrep.OpenResultset(rdOpenStatic, rdConcurRowver)

If rRes.EOF Then
  LogMess "RRDClass:WaitForNewClassification:Drum " & Trim(RoDIdentity)
& " is missing from dyd."
  On Error Resume Next
  rRes.Close
  rPrep.Close
  rOSCARCon.RollbackTrans
  WaitForNewClassification = False
  Exit Function
End If

While rRes!d_drum_in_process_flag = "H"
  
  'Wait for a few seconds before retrying
  
  StartTime = Timer
  
  While Timer < StartTime + 10
    DoEvents
  Wend
 
  If rRes.Restartable Then
    rRes.Requery
  Else
    MsgBox "Unable to restart rres"
  End If
  
Wend


	Thanks,
		Rich.
1339.3looks like a Microsoft issue to me...M5::JBALOGHFri May 09 1997 16:5145
    Rich, 
    
    For this problem, we need a different kind of log. Get the customer to
    enable SQLTracing in the ODBC administrator and get the SQL.LOG. 
    
    I really think the customer will have to push back with Microsoft on
    this one anyway. Microsoft's own ODBC specification details exactly how 
    errors are formatted. From pg 145 in the Microsoft ODBC Programmers 
    Reference, 
    
    "For errors that do not occur in a data source, the error text must use
    the format:
    
    [vendor-identifier][ODBC-component-identifier]component-supplied-text
    
    So, 
    
    [MICROSOFT] [ODBC Cursor Library]HSTMT bindings may not be changed
    	when cursor is open
    
    Means the error, 
    
    HSTMT bindings may not be changed when cursor is open
    
    is being returned by the 
    
    [Microsoft][ODBC Cursor Library]
    
    I don't know if this is being caused by something the customer is doing
    or something VB is doing but I doubt we will see anything in any RDB
    ODBC log files (since the error is being returned by MS before it gets
    to us).
    
    >Microsoft say that 0000000 is a valid value to unbind a column
    
    This is probably true but the error indicates the cursor must be closed
    before you can change the binding.
    
    I would suggest the customer talk to someone in Microsoft who is more
    fluent in native ODBC and I would certainly not file a BUG report just
    because Microsoft said so...
    
    John
    
    
1339.4Its there now...UKVMS3::RVIRRHigh cost of ownership...Mon May 12 1997 09:5610
John,
	Sorry, I forgot to copy the ODBC admin trace file, its SQL1.LOG on
ukvms3::DISK$RDB2:[RVIRR].
 
>>I would certainly not file a BUG report just because Microsoft said so...
Too right!  But MS has seen these files and insisted that it was a driver
problem.  Cust has re-opened his call with MS and I'll try to talk to them
directly.  

	Rich.
1339.5UKVMS3::PJACKSONOracle UK Rdb SupportMon May 12 1997 10:334
    If it is a driver problem, then the error message is wrong, so MS need
    to fix that.
    
    Peter
1339.6UKVMS3::RVIRRHigh cost of ownership...Wed May 21 1997 14:1040
Hello,
	I've tried this with the Oracle for Rdb ODBC driver 2.0.20 and the Oracle73 ODBC driver.  It fails with the Rdb
driver but is OK with the Oracle73 and SqlServer drivers.
 
I've provided my code if anyone wants to try this:
If you are using VB4 it must be enterprise version.

1) Set up a ODBC DSN through control panel
2) Start a new project.  From the tools menu choose references and make
sure Microsoft RDO 1.0 is selected.  (This is making a reference to the
RDO object library therefore allowing VB to understand/compile the RDO
code.)
3) Choose view code, then select Object: Form Proc: Click
4) Paste the code into the form click event making sure the following statement referenced your DSN.
Set cn = rdoEngine(0).OpenConnection("", False,False,"DSN=MYPUBS;uid=sa;pwd=;")
i.e. DSN=NameOfYourDSN

Code:

 Private Sub Form_Click()
     Dim cn As rdoConnection
     Dim rs As rdoResultset

     Set cn = rdoEngine(0).OpenConnection("", False, False,"DSN=MYPUBS;uid=sa;pwd=;")
     Set rs = cn.OpenResultset("Select employee_id FROM employees",rdOpenStatic, rdConcurReadOnly)
     Debug.Print "got rs"
     Debug.Print rs("employee_is")
     Debug.Print "Requery about to happen"
     rs.Requery
     Debug.Print "Requery"
     Debug.Print rs("employee_id")
     Debug.Print "Closing..."
     rs.Close
     Set rs = Nothing
     cn.Close
     Set cn = Nothing
 End Sub

	Thanks,
		Rich.