-
Can any one help me in my school project airport where we have to join database with visual basic......0
-
Member • Dec 28, 2008
Re: Help me in schoo project
Hi safwan !
Are you referring any book or not?
If no, ask here for any books or tutorials first.
If yes, Please directly jump over to Data Adapters and data sets chapter and read it thoroughly. Any help required post it here 😀.Are you sure? This action cannot be undone. -
Member • Dec 30, 2008
salam.....i do have a project in which we use visual basic as a front end and oracle as a back end. The connection with the back end (oracle) is done through certain coding's in visual basic. The coding may differ in accordance to your theme of your project so this is what i could help you.safwanCan any one help me in my school project airport where we have to join database with visual basic......
the coding goes like :-
Dim con as new adodb.connection
Dim rs as new adodb.record set
con.open "dsn=(name of your dsn);uid=(user id that is used to login you oracle );pwd=(password);
rs.open "select * from (table name)",con,1,2
msg box"oracle connected"
end sub
the length of the codings depends on the number of command buttons used in the form.
before giving the connection you have to create database for oracle,which acts the dsn name. for creating the dsn go to mycomputer-control pannel-administrative tools-data sources (odbc). once you click the data source a box will be opened , in that you'll having an option called add,click that new dialog box will be opened, now select the database for oracle and click finish.
The info which i have provided is upto my knowledge. correct me if its wrong. allah hafizAre you sure? This action cannot be undone. -
Member • Dec 30, 2008
Hi...
I think your concepts are not clear because you are just saying the database and not saying whether its a in oracle on in access.
See the code is little bit different for both oracle and access so first of all find out what is necessary .. concern with your teacher what should you use for your project for database....
then just inform me then i will send you connectivity code in vb and also i will give u instruction whatever require for connection
Best of luck..Are you sure? This action cannot be undone. -
Member • Dec 30, 2008
salam,
nilesh and zia
ahhhhh i am student of class 11 i have a subject informatics in which they teach us visual basics and oracle 10 g sql . they have teach us how to use data controll . means how to join ms access and exel . but i want the tabels which i have created of table passenger , so how to access the data from this table . but for this i have to join oracle so please help brothers.
thanks and allah hafizzzAre you sure? This action cannot be undone. -
Member • Dec 30, 2008
Re: Help me in schoo project
sir i am refering two books for visual basicsshalini_goel14Hi safwan !
Are you referring any book or not?
If no, ask here for any books or tutorials first.
If yes, Please directly jump over to Data Adapters and data sets chapter and read it thoroughly. Any help required post it here 😀.
1 my school informatics books (grad 11 cbsc)
2 and mcgrow hill visual basics
thanksAre you sure? This action cannot be undone. -
Member • Dec 30, 2008
safwansalam,
nilesh and zia
ahhhhh i am student of class 11 i have a subject informatics in which they teach us visual basics and oracle 10 g sql . they have teach us how to use data controll . means how to join ms access and exel . but i want the tabels which i have created of table passenger , so how to access the data from this table . but for this i have to join oracle so please help brothers.
thanks and allah hafizzz
ok ..
1) Create table in sql as
create table login (
mem_id number(5),
mem_name varchar2(20));
it will create a table in oracle
then
insert into login values(1,'nilesh');
insert into login values(2,'ritu');
2)
in a VB create one module ( i prefer with module because in module we write connection code n then in future just call the code (function ) in any form where we require it
code:-
declarations:-
Public cmd As String
Public con As ADODB.Connection
i m crating a function here now in each for when we require we just write call connect in form load event
code:-
Public Sub connect()
cmd = "Provider=OraOLEDB.Oracle.1;Password=sasa;Persist Security Info=True;User ID=system"
Set con = New ADODB.Connection
With con
.ConnectionString = cmd
.Open
End With
id = 0
pp = 0
End Sub
code for login form:-
Option Explicit
Public con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Form_Load()
login_form.Top = (Screen.Height - login_form.Height) / 2
login_form.Left = (Screen.Width - login_form.Width) / 1
Set con = New ADODB.Connection
con.Open "bhola", "system", "sasa"
End Sub
Private Sub cmdlogin_Click()
Dim name As String, password As String, sql As String
If Text1(0).Text = "" Or Text1(1).Text = "" Then
MsgBox "BLANKS FIELDS ARE NOT ALLOWED"
If Text1(0).Text = "" Then
Text1(0).SetFocus
Else
Text1(1).SetFocus
End If
Exit Sub
Else
name = Trim(Text1(0).Text)
password = Trim(Text1(1).Text)
sql = "select name from login where name='" & name & "' and password='" & password & "'"
Set rs = New ADODB.Recordset
rs.Open sql, con, adOpenDynamic, adLockOptimistic
If rs.EOF Then
MsgBox "CHECK NAME AND PASSWORD"
Text1(0).Text = ""
Text1(1).Text = ""
rs.Close
Text1(0).SetFocus
Exit Sub
Else
MDIForm1.Show
Unload Me
End If
End If
End Sub
Private Sub cmdlogout_Click()
End
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If Index = 0 Or 1 Then
If KeyCode = 13 Then
Call cmdlogin_Click
End If
End If
End SubAre you sure? This action cannot be undone. -
Member • Dec 31, 2008
thanks bro
but i have problem in compiling this codes
when i v compiled it i showing me compiler error
on code " con as ADODB.Connection" its saying user define type not define so sorry but can u tell me what should i do i am beginer in vb but i v tried this . thanks for help
namesty
allahhafizzzAre you sure? This action cannot be undone. -
Member • Dec 31, 2008
sory bro i tried but not getting
same errore
please helpAre you sure? This action cannot be undone. -
Member • Dec 31, 2008
pls i'm into computer,pls i need ur help.i need project nd seminar telecommumicationAre you sure? This action cannot be undone. -
Member • Dec 31, 2008
before doing that you have to alter some settings in vb. did you did it????safwansory bro i tried but not getting
same errore
please helpAre you sure? This action cannot be undone. -
Member • Dec 31, 2008
what kind of help you need??? mention it clearlyifeanyipls i'm into computer,pls i need ur help.i need project nd seminar telecommumicationAre you sure? This action cannot be undone. -
Member • Jan 1, 2009
safwanthanks bro
but i have problem in compiling this codes
when i v compiled it i showing me compiler error
on code " con as ADODB.Connection" its saying user define type not define so sorry but can u tell me what should i do i am beginer in vb but i v tried this . thanks for help
namesty
allahhafizzz
Before the compiling above code which i wrote in above link you have to add up components from vb as
1) project - components microsoft Ado data control (OLEDB) 6.0
2) PROJECT - REFRANCES- MICROSOFT ACITVEX DATA OBJECT 2.0
THATS ALL NOW YOU CAN RUN YOUR PROJECT
BEST OF LUCKAre you sure? This action cannot be undone. -
Member • Jan 1, 2009
I got
2 nd option.
but 1 st option still not getiin .
any how thanks brothors and for more information i am using student data file vb 0.6
i am also having visual studio express edition 2008Are you sure? This action cannot be undone. -
Member • Jan 1, 2009
noops i have not changed any settings in vb although iam serching those components in project - commponents - in - insertable objectszia.sepsisbefore doing that you have to alter some settings in vb. did you did it????
is that same settings wich someone posted here,
thanks man.Are you sure? This action cannot be undone. -
Member • Jan 1, 2009
1 st option is go to project then refrances then add OLEDB 6.0safwanI got
2 nd option.
but 1 st option still not getiin .
any how thanks brothors and for more information i am using student data file vb 0.6
i am also having visual studio express edition 2008Are you sure? This action cannot be undone. -
Member • Jan 2, 2009
brother that what oledb 6.0 i am not getting in my components of vb so do i have to download it .
if i have to download it than please tell me link.Are you sure? This action cannot be undone.