Home » Other » General » VB Oracle connection query problem
icon5.gif  VB Oracle connection query problem [message #116330] Tue, 19 April 2005 08:43
dilzone
Messages: 1
Registered: April 2005
Junior Member
Hi Everyone
I am having a very starne problem. I am able to connect to oracle using microsoft oracle driver as well as oracle driver. But i am having issue with both the drivers.

here is the code in vb:--------------
Dim con As New ADODB.Connection
Dim ConnStr As String
'Case 1
'ConnStr = "Provider=MSDataShape.1;Data Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=print;Password=source;Data Source=biis"

'Case 2
ConnStr = "Provider=MSDataShape.1;Data Provider=MSDAORA.1;User ID=print;Password=source;Data Source=biis;Persist Security Info=False"

con.Open ConnStr

Dim rs As New ADODB.Recordset
rs.Open "Select Id, Parent_ID, Name, Level ,(Select Count(Product_Id) From Product Where Class_Id = Class.Class_Id ) as Cnt From Class ", con, adOpenStatic, adLockReadOnly

MsgBox rs.RecordCount

----------------------------------------------
Case 1 gives following error..
Run-time error '-2147217900(80040e14)':
ORA-00907: missing right parenthesis

------------------------------------------------
Case 2 does executes the query properly but i get record count as -1 although it has record count of 17.

If i run the query independtly in oracle consile o get the output of 17 records.

------------------------------------------
And also its sure that i need to use datashape in the query i have used it.

Please help me in the aboce case.

Thanks in advance
Previous Topic: newbie : What is oracle/ERP ?
Next Topic: Oracle Clinical
Goto Forum:
  


Current Time: Sun Dec 29 04:21:01 CST 2024