PDA

Click to See Complete Forum and Search --> : RDO: Oracle 8.0.5 Query (URGENT)


Dec 22nd, 1999, 12:36 AM
Hello;
I'm Khamal, my condition :-
1. I'm using oracle 8.0.5 both for client and server
2. I had create the database on client pc and communication was greate, now
i'm able to add the new data using MSRDC(Microsoft Remote Data Control 6.0)
3. My server running on windows NT SP3
4. Client running smoothly on windows98
5. My table do have field: (name, address, telephoneno)

My question is
1. I had problem in quering field to text box
My command:
*********************************************
Private Sub Text2_LostFocus()
Dim ssql As String

With MSRDC1
ssql = "select * from contoh1 where name= & Text2.Text &"
.SQL = ssql
.CursorDriver = rdUseClientBatch
.LockType = rdConcurRowVer
.ResultsetType = rdOpenStatic
End With
Text1.DataField = "address" -error message appear
Text3.DataField = "telephoneno"

End sub

*********************************************
should you have any suggestion please email me at cosmos74@tm.net.my.

Thank you


------------------
Khamal

Clunietp
Dec 22nd, 1999, 01:44 AM
Change this line:
ssql = "select * from contoh1 where name= & Text2.Text &"

To:
ssql = "Select * from contoh1 where name = '" & text2.text & "'"


=====================================
I'm not sure if you need the single quotes when querying an Oracle text field (I would think so....)

Tom

Clunietp
Dec 22nd, 1999, 01:46 AM
If that does not solve your problem, please post the error message, thx

smalig
Dec 22nd, 1999, 03:37 AM
Try it:

------------------------
Dim rdoCn As New rdoConnection

With rdoCn
.Connect = "DSN=oracle8;UID=user;PWD=pass;"
.LoginTimeout = 25
.CursorDriver = rdUseOdbc
.EstablishConnection rdDriverNoPrompt, False
End With

Dim rdoSet As rdoResultset

sSql = "select * from contoh1 where name= & Text2.Text &"
Set rdoSet = rdoCn.OpenResultset(sSQL)

vVar = rdoSet.rdoColumns.Item(0)
rdoSet.Close
Set rdoSet = Nothing
rdoCn.Close

------------------
smalig
smalig@hotmail.com
http://vbcode.webhostme.com/

Dec 22nd, 1999, 04:54 AM
Thank you for your support, but still error
----------
Private Sub Text2_LostFocus()
Dim ssql As String

Dim rdoCn As New rdoConnection

With rdoCn
.Connect = "DSN=Abu;UID=contoh;PWD=contoh1;"
.LoginTimeout = 25
.CursorDriver = rdUseOdbc
.EstablishConnection rdDriverNoPrompt, False
End With

Dim rdoSet As rdoResultset

ssql = "select * from contoh1 where name = '" & Text2.Text & "'"
Set rdoSet = rdoCn.OpenResultset(ssql)**error

///Error message [Oracle][ODBC][ora]ORA-00904 - Invalid Colums name///

vVar = rdoSet.rdoColumns.Item(0)
rdoSet.Close
Set rdoSet = Nothing
rdoCn.Close

Text1.DataField = "address"
Text3.DataField = "telephoneno"
End Sub

Thank you Clunietp and Smalig

Dec 22nd, 1999, 05:49 AM
SORRY.....

the error massage is minor at

Text1.DataField = "address"
Text3.DataField = "telephoneno"

////Unable to bind/////////


Thank you....

------------------
Khamal

Clunietp
Dec 22nd, 1999, 08:54 AM
Why are you binding the textboxes AFTER you close the connection? Of course, after you close and release the recordset, you can no longer bind fields to it...

Clunietp
Dec 22nd, 1999, 08:57 AM
Are you binding your textboxes to a data control, and then setting the recordset of that data control?

You cannot bind controls to a recordset if you create the recordsource at runtime....

Dec 24th, 1999, 02:39 AM
TQ Cluenitp;

Suddenly i found what i need is the ADO connection, tQ for you support. and i appreciate you and desribe you a very helpfull person.

I'm new in VB previously in Delphi, so i hope that my question above did not wase you any.


------------------
Khamal

Clunietp
Dec 24th, 1999, 01:41 PM
I NEVER would have guessed that one! It seems that you were keen on using RDO.

Oh well, at least I got you thinking!

Tom