![]() |
|
|
| Subject:
Need help about Visual basic 6.0
Category: Computers > Programming Asked by: matrixx-ga List Price: $10.00 |
Posted:
07 Aug 2004 05:17 PDT
Expires: 06 Sep 2004 05:17 PDT Question ID: 384680 |
hello: i wanna good tutorials how to connect a database Access with visual basic , i didn't find a good answers for that , please help me with all details and with the whols ways , thank you so much |
|
| There is no answer at this time. |
|
| Subject:
Re: Need help about Visual basic 6.0
From: buzzau-ga on 08 Aug 2004 22:31 PDT |
Would detailed code be sufficient or did you want a link to a particular document? |
| Subject:
Re: Need help about Visual basic 6.0
From: matrixx-ga on 09 Aug 2004 09:16 PDT |
Yes , but it's not an answer " There is no answer at this time " i didn't write to you to heard that , and it's not an answer , i don't know why did you make this url ??? if you Can't answer people ??? ! and i didn't give money to hear ==> " There is no anwer at this time " ?? what does it mean ? are you sleeping or what so please i wanna a good answer to my question. |
| Subject:
Re: Need help about Visual basic 6.0
From: tcarternyc-ga on 09 Aug 2004 11:00 PDT |
Hi matrixx,
Here is a good example of what you would like to do.
Dim sConn as string 'for the connection string
Dim db as New ADODB.Connection
dim rs as new ADODB.Recordset
dim sPath as string ' here we put the path of your database
dim sSQL as string 'your SQL Statement
'like for example your vb application is on C:\MyVB
' and within that your DB is under another folder called DB
' we must get the path C:\MyVB\DB\yourdbname.mdb
' we shall be using app.path for getting the path of your application
that is the C:\MyVB
' then we must concatenate the folder and the name of your database.
sPath = app.path & "\DB\yourdbname.mdb;"
'initialize the connection string
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sPath
sSQL = "SELECT * FROM yourtablename"
now let us proceed to the main part
Private Sub frmMain_Load()
db.ConnectionString = sConn
db.Open
with rs
.activeconnection = db
.locktype = adlockoptimistic
.cursortype = adopenkeyset
.open sSQL
' now let us loop through your records and show it to your label
' for example your table has two fields, the field called name and description
do while not .eof
label1.caption = .fields("name").value & vbCrLf &
.fields("description").value & vbCrLf
.movenext
loop
'let close the rs connection
rs.close
end with
set rs = nothing
db.close
set db = nothing
End Sub |
| Subject:
Re: Need help about Visual basic 6.0
From: matrixx-ga on 15 Aug 2004 11:37 PDT |
Thanks for your help , but it's not enough only 1 exemple i need sites where i can find many exemple for that . Note : Your exemple isn't working anyway |
| Subject:
Re: Need help about Visual basic 6.0
From: juergenhartl-ga on 22 Aug 2004 11:06 PDT |
navigate to http://www.planetsourcecode.com/ and do a search. You will find plenty of examples and tutorials on Database and VB |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |