473,399 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

vb application to oracle connection

this is the code i wrote for my application to retrieve values,delete values,update values and insert values...

i am havin doubt in delete and retrieve snippets whether it works right. and deletion should ask for the primarykey which is traderid over here and on getting it,it retrieves all details for the particular user and deletes it. i couldnt check out right now as i dont have connection.

'adodc control

Private Sub Adodc1_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)

End Sub

'reset all values/clear the values

Private Sub Command9_Click()

firstname.Text = ""
middlename.Text = ""
lastname.Text = ""
sex.Text = ""
city.Text = ""
state.Text = ""
country.Text = ""
mailid.Text = ""
userid.Text = ""
password.Text = ""
traderid.Text = ""

End Sub


'retrieve contents
Private Sub Command1_Click()

Dim sql As String
sql = "select * from trader;"
'specify format of SQL result and assisgn to ADODC
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = sql
Adodc1.Refresh

End Sub


'insert records

Private Sub Command3_Click()

Adodc1.Recordset.AddNew

Adodc1.Recordset.Fields("firstname") = firstname.Text
Adodc1.Recordset.Fields("middlename") = middlename.Text
Adodc1.Recordset.Fields("lastname") = lastname.Text
Adodc1.Recordset.Fields("sex") = sex.Text
Adodc1.Recordset.Fields("city") = city.Text
Adodc1.Recordset.Fields("state") = state.Text
Adodc1.Recordset.Fields("country") = country.Text
Adodc1.Recordset.Fields("mailid") = mailid.Text
Adodc1.Recordset.Fields("userid") = userid.Text
Adodc1.Recordset.Fields("password") = password.Text
Adodc1.Recordset.Fields("traderid") = traderid.Text

Adodc1.Recordset.Update

MsgBox "Data inserted and updated"
End Sub

'delete records by retriving the details using traderid details and deleting.

sql = "select firstname,middlename,lastname,sex,city,state,count ry,mailid,panno,userid,password,traderid from trader where traderid=&traderid;"
If Adodc1.Recordset.EditMode = adEditDel Then
If MsgBox("Do you really want to delete ?", vbYesNo) = vbYes Then
Adodc.Recordset.Delete
End If
End If
Unload Me

End Sub
Sep 4 '07 #1
4 2955
KevinADC
4,059 Expert 2GB
Wrong forum, hopefully a moderator will move your thread shortly.
Sep 4 '07 #2
Wrong forum, hopefully a moderator will move your thread shortly.
hello mr.kevin, i asked whether anyone cud help me out in viewing the records and also deletion and updation..i asked to verify and help me out not tell anythin like your thread will be moved. please help me out people
Sep 5 '07 #3
hariharanmca
1,977 1GB
Invert this code
Expand|Select|Wrap|Line Numbers
  1. firstname.Text = Adodc1.Recordset.Fields("firstname") 
  2. middlename.Text = Adodc1.Recordset.Fields("middlename") 
  3. lastname.Text = Adodc1.Recordset.Fields("lastname") 
  4. --------------------
  5. -------------
  6. ---------
  7. --
use four command button and write code for
Move Next
Move Previous
Move First
Move Last

Now, by clicking the commands you can view record in text box

To delete

ADODC1.RecordSet.Delete (which is the text boxes)

Expand|Select|Wrap|Line Numbers
  1. Adodc1.Recordset.Edit
  2.  
  3. Adodc1.Recordset.Fields("firstname") = firstname.Text
  4. Adodc1.Recordset.Fields("middlename") = middlename.Text
  5. Adodc1.Recordset.Fields("lastname") = lastname.Text
  6. Adodc1.Recordset.Fields("sex") = sex.Text
  7. Adodc1.Recordset.Fields("city") = city.Text
  8. Adodc1.Recordset.Fields("state") = state.Text
  9. Adodc1.Recordset.Fields("country") = country.Text
  10. Adodc1.Recordset.Fields("mailid") = mailid.Text
  11. Adodc1.Recordset.Fields("userid") = userid.Text
  12. Adodc1.Recordset.Fields("password") = password.Text
  13. Adodc1.Recordset.Fields("traderid") = traderid.Text
  14.  
  15. Adodc1.Recordset.Update
This is the concept. Try your best.
Sep 5 '07 #4
QVeen72
1,445 Expert 1GB
Hi,

After reading the TradeID, u have to find it in the ADODC, if found, then Delete, and then Refresh.. Something like this :

Expand|Select|Wrap|Line Numbers
  1.  ADODC1.RecordSet.MoveFirst
  2.  ADODC1.RecordSet.Find "tradeID=" & TradeID
  3.  If Not ADODC1.RecordSet.EOF Then
  4.    ADODC1.RecordSet.Delete
  5.    ADODC1.RecordSet.Refresh
  6.   ADODC1.RecordSet.MoveFirst
  7.  Else
  8.    Msgbox "Trade ID Not Found"
  9.  End If
  10.  
REgards
Veena
Sep 5 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Harry | last post by:
Using Oracle 8i enterprise on win 2000 (sp3) Installed the standard configuration & whenever I make a connection it takes about 10 secs. It's running on a P1900 with 1gb Ram so no reason there...
1
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this...
9
by: mcbill20 | last post by:
Hello all. I just installed Oracle 10g developer tools on a machine running XP Pro and Office XP. Before this I had just the Oracle 9 client installed. I the previous configuration, I was able to...
0
by: ʹÃûÑï | last post by:
ORA-03114: not connected to ORACLE && MS's Bug?? DataBase:Oracle 817 using OracleClient,net framework 1.1 I'm using ADO.Net in C# with Oracle 817. and following is my public data access...
1
by: mingki | last post by:
Hi Developers, I am a .Net developer of a Large Online Retailling Company. I would like to have your help on a Connection Pool issue. Recently we have developed a Web Application on ODP .Net...
1
by: ori | last post by:
Hi, I have an ASP.Net application hosted in a windows server 2003 (IIS 6.0). The application uses a Oracle Database to retrieve some data through an Oledb connection. I've set the IIS...
2
by: amjad | last post by:
Hi when i try below code public DataSet GetData(string ConString) { OracleDataAdapter da; DataSet ds = new DataSet(); // Setup connection string to access Oracle 9i
7
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables,...
2
by: Amjad Mahmood | last post by:
I have recently joined a pharmacuetical company as a Manager M.I.S I have source code of an oracle application developed in 6i by my predecessor. I am unable to take help from him due to some...
0
by: sudhaoncyberworld | last post by:
Dear Techies, I do have small issue on connecting oracle server from .net This is the code snippet public string strConString = "Driver={Microsoft ODBC for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.