Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > need help and fast

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-31-02, 10:39
SairamP SairamP is offline
Registered User
 
Join Date: Feb 2002
Location: India
Posts: 11
Unhappy need help and fast

hey everybody
i am working on project in which i am using vb and oracle 8i.....
i have a text-box in vb in which if the user types in a name i want the other text box to get the corresponding name from oracle table....
i know how to connect oracle and vb...but the quyery execution for a text-box i am finding it difficut...plz tell me abt this and also how to execute queries which retuen a single value that i can place in text-box.
plzz help me real soon..
sairam
Reply With Quote
  #2 (permalink)  
Old 04-02-02, 11:14
Rafael_Machado Rafael_Machado is offline
Registered User
 
Join Date: Mar 2002
Location: Santos - SP - Brazil
Posts: 13
Re: need help and fast

Hi SairamP,

Try to read something about ADO, and Recordset and Connection, this information can be found in the URL www.msdn.com

In following a sample in vb of a query which return a single value, i hope this can help you.

Dim RS as ADODB.RECORDSET
Dim db As ADODB.Connection

Connect = "Provider=XXX;Password=XXX;User ID=XXX;Data Source=XXX;Persist Security Info=True"

DB.ConnectionString = Connect
DB.Open

Rs.ActiveConnection = DB.connect
rs.Open "select ..."
do until rs.EOF
TEXT1.TEXT = RS.Fields(0)
rs.MOVENEXT
loop

Regards Rafael,

Quote:
Originally posted by SairamP
hey everybody
i am working on project in which i am using vb and oracle 8i.....
i have a text-box in vb in which if the user types in a name i want the other text box to get the corresponding name from oracle table....
i know how to connect oracle and vb...but the quyery execution for a text-box i am finding it difficut...plz tell me abt this and also how to execute queries which retuen a single value that i can place in text-box.
plzz help me real soon..
sairam
Reply With Quote
  #3 (permalink)  
Old 04-08-02, 11:58
SairamP SairamP is offline
Registered User
 
Join Date: Feb 2002
Location: India
Posts: 11
thanks Rafael......sometimes the recordset eof and bof do throw up some errors............anyways if i make a project of the program i am developing using vb and oracle will the user who runs it need oracle and will he have the power to see the database if he is an oracle developer
Reply With Quote
  #4 (permalink)  
Old 04-08-02, 12:22
Rafael_Machado Rafael_Machado is offline
Registered User
 
Join Date: Mar 2002
Location: Santos - SP - Brazil
Posts: 13
Hi SairamP,

The user need to have the Oracle Client in his workstation, and you can see the database normally, because the application is different but the database is the same.
Do you understand ?


Rafael.
Reply With Quote
  #5 (permalink)  
Old 04-09-02, 00:08
SairamP SairamP is offline
Registered User
 
Join Date: Feb 2002
Location: India
Posts: 11
hii RAfael..tnakx for taking pains to reply to my question..but i just cant help them..they keep popping one by one...when i insert records in the table using rs.execute where rs is the recordset the recordset inserts the data in the table but doesnt get refreshed i.e the changes are not visible immediately....i am using the provider msdasql...i can see the insertion in oracle immediately but not in the recordset..the record count doesnt get updated immediately too...is there a fuction in ADO like the one in DAO like data_reposition so that i can show the position(count) as to where the user is in table....
thanks once again...hoping for ur invaluable reply...
sairamP
Reply With Quote
  #6 (permalink)  
Old 04-09-02, 23:56
raju raju is offline
Registered User
 
Join Date: Jan 2002
Posts: 28
Sriram,

When you use rs.execute() which will take the result and put it in yr buffer (client) and the update the database when you issue the update command. for refreshing the data you can add the item in the recordset or you have to execute the recordset to get the updated value( which will in turn takes the latest record from the database..)

good luck...

raju
Reply With Quote
  #7 (permalink)  
Old 04-10-02, 12:03
Rafael_Machado Rafael_Machado is offline
Registered User
 
Join Date: Mar 2002
Location: Santos - SP - Brazil
Posts: 13
Hi SairamP,

Raju is right in his solution, but i think that is more easy to use the RESYNC method in recordset
This Method Refreshes the data in the current Recordset object from the underlying database.
In following a sample that i get in MSDN documentation, i hope this help you.

'=============
Public Sub ResyncX()

Dim strCnn As String
Dim rstTitles As ADODB.Recordset

' Open connections.
strCnn = "Provider=sqloledb;" & _
"Data Source=srv;Initial Catalog=pubs;User Id=sa;Password=; "

' Open recordset for titles table.
Set rstTitles = New ADODB.Recordset
rstTitles.CursorType = adOpenStatic
rstTitles.LockType = adLockBatchOptimistic
rstTitles.Open "titles", strCnn, , , adCmdTable

' Change the type of the first title in the recordset.
rstTitles!Type = "database"

' Display the results of the change.
MsgBox "Before resync: " & vbCr & vbCr & _
"Title - " & rstTitles!Title & vbCr & _
"Type - " & rstTitles!Type

' Resync with database and redisplay results.
rstTitles.Resync
MsgBox "After resync: " & vbCr & vbCr & _
"Title - " & rstTitles!Title & vbCr & _
"Type - " & rstTitles!Type

rstTitles.CancelBatch
rstTitles.Close

End Sub
'=============
Regards,

Rafael
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On