Results 1 to 3 of 3

Thread: Pass Through

  1. #1
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Unanswered: Pass Through

    I'd like to make a pass through Query to get the Tables names in an Informix DB through ODBC. I started in VB6 the next code

    PHP Code:
    Dim wrkODBC As WorkSpace
    Dim conPubs 
    As Connection

      Set wrkODBC 
    CreateWorkspace("NewODBCWorkspace"_
            
    "Admin"""dbUseODBC)
      
    Set conPubs wrkODBC.OpenConnection("Verb1", , , _
            
    "ODBC;DATABASE=Verleger;UID=sa;PWD=;DSN=Verleger"

      
    conPubs.CreateQueryDef """SELECT * FROM systables" 
    Systables is like MSysObjects in ACCE$$ contains information of all tables.

    Is it possible to do that without using workSpace Jet in which I should Open an Acce$$ Db?

    What is the next step?
    Who can help me getting the tables names through this Verleger ODBC?
    Thanks
    Last edited by hammbakka; 11-12-04 at 04:06.

  2. #2
    Join Date
    Feb 2004
    Posts
    137
    Try:
    Code:
    Dim wrkODBC As WorkSpace 
    Dim conPubs As Connection 
    Dim rstPubs As Recordset
    Dim x As Long, y As Long
      Set wrkODBC = CreateWorkspace("NewODBCWorkspace", _ 
            "Admin", "", dbUseODBC) 
      Set conPubs = wrkODBC.OpenConnection("Verb1", , , _ 
            "ODBC;DATABASE=Verleger;UID=sa;PWD=;DSN=Verleger" 
    
      Set rstPubs=conPubs.OpenRecordset("SELECT * FROM systables")
    
      For x = 0 to rstPubs.Fields.Count-2
        Debug.Print rstPubs.Fields(x).Name;" | ";
      Next x
      Debug.Print rstPubs.Fields(x).Name
    
      Do While Not rstPubs.EOF
        For x = 0 to rstPubs.Fields.Count-2
          Debug.Print rstPubs.Fields(x).Value;" | ";
        Next x
        Debug.Print rstPubs.Fields(x).Value
        rstPubs.MoveNext
      Loop
    
      rstPubs.Close
      conPubs.Close
      wrkODBC.Close

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Thank you for your reply, I'll have a trial....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •