AdoDB Connection String for Valentina v3?

Barry G. Sumpter BarrySum at BigPond.Net.AU
Fri May 25 19:03:49 CDT 2007


Hi all,

There are comments on Valentina web site stating that v2(?) now supports
ADO.

Anyone, anyone at all, know what the ADODB connection string is for
Valentina v3?


REALbasic 2007 r2
Valentina v3
Windows XP sp2

...
AdoDB Support. A data abstraction layer used by database solution providers
to interface with a broad range of enterprise class database servers and
technologies.
...

C:\Program Files\REAL Software\REALbasic 2007r2\Examples\Windows OS
specific\Win32 ADO Example\adoexample.rbp

  Dim adodbConnection as new OLEObject( "ADODB.Connection" )
  Dim adodbCommand as new OLEObject( "ADODB.Command" )
  Dim adodbRecordSet as OLEObject
  Dim adodbFields as OLEObject
  Dim adodbField as OLEObject
  Dim connectionString as string
  Dim iter as integer
  Dim fieldCount as integer
  
  connectionString = "DRIVER={Microsoft Access Driver (*.mdb)};"
  connectionString = connectionString + "DBQ=ADODEMO.MDB;"
  connectionString = connectionString + "UID=admin;PWD=;"
  
  adodbConnection.Open( connectionString )
  
  adodbCommand.ActiveConnection = adodbConnection
  adodbCommand.CommandText = "select * from authors"
  adodbRecordSet = adodbCommand.Execute
  
  adodbFields = adodbRecordSet.Fields
  fieldCount = adodbFields.Count
  
  listbox1.ColumnCount = fieldCount
  
  while not adodbRecordSet.EOF
    adodbFields = adodbRecordSet.Fields
    
    listBox1.addrow ""
    
    for iter = 0 to fieldCount-1
      adodbField = adodbFields.Item( iter )
      listBox1.cell(listBox1.listcount-1, iter) = adodbField.Value("Value")
    next
    
    adodbRecordSet.MoveNext
  wend
  
exception err as OLEException
  msgbox err.message



More information about the Valentina mailing list