janab e aali aapki bari mehrbani hogi ke ager aap data base ka koi program banana sikhaen plzzzzzzzzzzzzzzzzzzzzzzz
janab e aali aapki bari mehrbani hogi ke ager aap data base ka koi program banana sikhaen plzzzzzzzzzzzzzzzzzzzzzzz
u can contact me
*****
Last edited by Fatima Iqbal; 11th July 2011 at 10:47 AM. Reason: Remove Email ID
Please Share Your knowledge here.
Visual basic ko SQL se connect kerne k liye hum ADO (ActiveX data object) use kereinge...
aap ye reference se add kersakte hain.. "Microsoft ActiveX Data Objects 2.8 Library"
CODE LEVEL...
sab se pehle hum connection aur recordset k instances create kareinge..
Recordset mein hum record save kerte hain...HTML Code:Dim MyConnObj As New ADODB.Connection Dim myRecSet As New ADODB.Recordset
is k baad connection create hota hai...
serverName = your computer name/localhost/IPHTML Code:MyConnObj.Open _ "Provider = sqloledb;" & _ "Data Source={ServerName};" & _ "Initial Catalog={DatabaseName};" & _ "User ID={UserName};" & _ "Password={Password};"
DatabaseName = jis se aap link kerna chahte hain. jahan se record aayeinge.
username and password k baray mein to aap ko ilm hoga.. SQL ka username or password..
is ke baad hum ek string banayeinge jo k SQL QUERY hai..
then we get records in record set...HTML Code:dim sqlStr as string sqlStr = "select * from tablename"
is command se tamam record myRecSet mien save hojayeinge...HTML Code:myRecSet.Open sqlStr, MyConnObj, adOpenKeyset
agar aap ko dekhna hai k kitne records save huay hain to simply aap type kareinge..
aur agar tamam records aap ko dekhne hain to aap ko looping kerni paregi..HTML Code:myRecSet.recordcount
0,1,...... ; yeh sab columns hain.. 0->1st column, 1->2nd ColumnHTML Code:while Not myRecSet.EOF 'means jab tak records khatam nahi hotay.. textbox.text = textbox & myRecSet(0) & myRecSet(1) and so on.. myRecSet.movenext wend
phir movenext dooosre record pe chala jayega aur issi tarah saray records aap k saamne ajayeinge...
THANKYOU FOR VISITING...
REGARDS
ARSLAN
SOFTWARE DEVELOPER
agr men acceesss database use karon to kya code hoga?or dosra sawal ye he k agr vb form men text box ki value access k table ki value se kese compare karwaenge???mjhe login form banana he....plzzz help me....men pareshaan hogai try kar kar k nahi solve horaha ye problem....
Ek Control hota hai ADODC uski properties mein option hota hai link ka.. Woh her ek ko link kerta hai aur connection banadeta hai.. so aap access ko easily link kar sakte hain....
and login form banana mushkil nahi...
aap ka jo recordset hai us se field get kerlein aur easily use kerein...
textbox.text = recordset!username
like this...
bohat bohat shukria apk response ka...men try kark aapko bataongiii...ok....
bs ye btaden k is men condition kya lagaenge yehi wali jo apne likh jr di he ....ya EOF wali condition lagegi If k sath..plz kese chek karenge iski cding btaden...men charhi hon k agr username dtabase me ho to form2 men jae otherwise error ka msg dede..plzzz helpme...kya condition lagegi...?
salaaam
agr 2 condition lagana ho to kese karenge ,mjhe login form k lye username name or password dono ko chk karwana he...men dono sath likhti hon to error deta he jese
If textbox1.text=rs!username and text2.text=rs!password Then
form2.show
is per error deta he...jab k sql string ye he..
str="select username,password from login where username='" &textbox1.text &'" and password='" & textbox2.text & "'"
bataen kya hal he iskaaa???/plzzz
aap Textbox.text k sath trim lagadein..
Trim(Txtbox.text)
Bookmarks