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
4 2955
Wrong forum, hopefully a moderator will move your thread shortly.
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
Invert this code -
firstname.Text = Adodc1.Recordset.Fields("firstname")
-
middlename.Text = Adodc1.Recordset.Fields("middlename")
-
lastname.Text = Adodc1.Recordset.Fields("lastname")
-
--------------------
-
-------------
-
---------
-
--
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) -
Adodc1.Recordset.Edit
-
-
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
This is the concept. Try your best.
Hi,
After reading the TradeID, u have to find it in the ADODC, if found, then Delete, and then Refresh.. Something like this : -
ADODC1.RecordSet.MoveFirst
-
ADODC1.RecordSet.Find "tradeID=" & TradeID
-
If Not ADODC1.RecordSet.EOF Then
-
ADODC1.RecordSet.Delete
-
ADODC1.RecordSet.Refresh
-
ADODC1.RecordSet.MoveFirst
-
Else
-
Msgbox "Trade ID Not Found"
-
End If
-
REgards
Veena
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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
|
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,...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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...
|
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,...
|
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...
| |