Results 1 to 10 of 10

Thread: RDO: Oracle 8.0.5 Query (URGENT)

  1. #1
    Guest

    Post

    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 [email protected].

    Thank you


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

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    If that does not solve your problem, please post the error message, thx

  4. #4
    Addicted Member
    Join Date
    Oct 1999
    Posts
    232

    Post

    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
    [email protected]
    http://vbcode.webhostme.com/



  5. #5
    Guest

    Post

    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

  6. #6
    Guest

    Post

    SORRY.....

    the error massage is minor at

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

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


    Thank you....

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

  7. #7
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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...

  8. #8
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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....

  9. #9
    Guest

    Post

    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

  10. #10
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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

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