Hi all,
I was wondering how can I loop through all the database in a
particular server using ADODB into a combobox? Below is the code I
tried using but didnt work, any hints/solutions for this anyone??
Thanks,
Henry
Dim Cnxn As ADODB.Connection
Dim rstSchema As ADODB.Recordset
Dim strCnxn As String
Cnxn = New ADODB.Connection
'Sybase ASE ODBC Driver Connection string - uses DSN
'strCnxn = "DSN=ase4141;UID=" & ;PWD=;"
strCnxn = "DSN=" & Me.cbxDataSource.Text & ";UID=" &
Me.tbxLogin.Text & ";PWD=" & Me.tbxPassword.Text
Cnxn.Open(strCnxn)
rstSchema = Cnxn.OpenSchema(ADODB.SchemaEnum.adSchemaSchemata)
Do Until rstSchema.EOF
Debug.WriteLine(rstSchema)
rstSchema.MoveNext()
Loop
' clean up
rstSchema.Close()
Cnxn.Close()
rstSchema = Nothing
Cnxn = Nothing