473,801 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb application to oracle connection

15 New Member
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.EventReas onEnum, adStatus As ADODB.EventStat usEnum, 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.CommandT ype = adCmdText
Adodc1.RecordSo urce = sql
Adodc1.Refresh

End Sub


'insert records

Private Sub Command3_Click( )

Adodc1.Recordse t.AddNew

Adodc1.Recordse t.Fields("first name") = firstname.Text
Adodc1.Recordse t.Fields("middl ename") = middlename.Text
Adodc1.Recordse t.Fields("lastn ame") = lastname.Text
Adodc1.Recordse t.Fields("sex") = sex.Text
Adodc1.Recordse t.Fields("city" ) = city.Text
Adodc1.Recordse t.Fields("state ") = state.Text
Adodc1.Recordse t.Fields("count ry") = country.Text
Adodc1.Recordse t.Fields("maili d") = mailid.Text
Adodc1.Recordse t.Fields("useri d") = userid.Text
Adodc1.Recordse t.Fields("passw ord") = password.Text
Adodc1.Recordse t.Fields("trade rid") = traderid.Text

Adodc1.Recordse t.Update

MsgBox "Data inserted and updated"
End Sub

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

sql = "select firstname,middl ename,lastname, sex,city,state, country,mailid, panno,userid,pa ssword,traderid from trader where traderid=&trade rid;"
If Adodc1.Recordse t.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 2974
KevinADC
4,059 Recognized Expert Specialist
Wrong forum, hopefully a moderator will move your thread shortly.
Sep 4 '07 #2
shreshta
15 New Member
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 Top Contributor
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.RecordSe t.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 Recognized Expert Top Contributor
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
14526
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 for slowness. Once I'm connected the queries work pretty much instantanously but to connect using SQLPLUS, Toad, ODBC, OLEDB all take about 10 secs. I connect using OLEDB from Visual Basic development environment & after the 1st connection...
1
9203
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 will work for 9i and even 10g ) No one had what I needed, so I wrote it myself. I Rule. This code isn't going for efficiency, and isn't trying to be dynamic. It doesn't create the table structure in Oracle, that's up to you. (I
9
17039
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 access any of the Oracle tables on another machine but now I am having problems. Unfortunately, I don't remember the correct syntax for the ODBC connect string and I am hoping that is my whole problem. I am trying to connect to an Oracle 9...
0
5779
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 class. using System.Data.OracleClient;
1
12155
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 to work with Oracle Database 10g. To gain the performance, connection pool enable is a must. Everything work fine throughout the development period and the performance is Great, however while the Web Application is deployed to the production,...
1
2118
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 application pool used by the application to get recycled when the application consumes too much memory which it ocasionally does and I don't want the server to hang. After this I stress the application to know it's performance and monitor it's...
2
4423
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
20333
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, if they do not already exist. In terms of ASP/ADO, that would be fine in a SQL Server Sense by a simply ASP/Server-Side JavaScript as such: var cnTemp = Server.CreateObject("ADODB.Connection");
2
2615
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 technical reasons. All I have is the server administration, source code files for oracle clients. I have to change the main connection password, but if I do so all the users will be unable to logon to the application. Does this mean that the...
0
3968
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 Oracle};Server=myserver;Uid=system;Pwd=mypwd;";
0
9698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9558
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10527
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10300
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9106
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5492
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2963
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.