Results 1 to 2 of 2

Thread: table or view doesnt exist

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2003
    Posts
    3

    Post table or view doesnt exist

    I am new to VB/ADO and oracle, and really need help. I am trying to get information from an oracle view and the error message says "ORA-00942 table or view does not exist." The view exists in the database, in SQL-PLUS data will appear, and a DESC will show all fields. What is wrong with this code or is something missing? Any reply is really appreciated. Thanks.


    Private Sub Command1_Click()
    Dim cn As ADODB.Connection
    Set cn = New ADODB.Connection
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    Dim cmd As ADODB.Command
    Set cmd = New ADODB.Command

    With cn
    .Provider = "OraOLEDB.oracle"
    .ConnectionString = "data Source = vmprod;user id=name;password=passwd;"
    .Open
    End With
    cmd.ActiveConnection = cn
    cmd.CommandText = "select sorderid from view_sum_ordrqty"
    cmd.CommandType = adCmdText
    Set rs = cmd.Execute
    While Not rs.EOF
    MsgBox rs!sorderid
    rs.MoveNext
    Wend

    rs.Close
    Set rs = Nothing
    cn.Close
    Set cn = Nothing
    End Sub

  2. #2
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857
    I tested you code and got no problems, so the code is good. I ran it against a stored query in the Northwind database, so I obviously had to change the connection string and sql statement, but the code was good.

    I would double-check the spelling of sorderid and view_sum_ordrqty in your Oracle database
    "Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!

    Resistance is futile, you will be compiled . . . Please!

Posting Permissions

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



Click Here to Expand Forum to Full Width