|
-
Jun 10th, 2003, 05:26 PM
#1
Thread Starter
New Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|