Click to See Complete Forum and Search --> : writing to a database in vb or .vbs
dustybunny
October 3rd, 2004, 06:06 PM
hi guys and gals,
Wow this place is great to learn from picked up loads of tips hopefuly i will be able to help someone and give loads of help but till then gonna keep learning anyways
i working in a webcafe and i would like to write to a DB file that has all the usernames, password ect. because the other staff find it hard to use the orginal programe so i though that would be gd anyone know of anygd tut's can u please point me in the right direction :D im not a total newbie with vbs i did study it at college and pass but writing to database's they didnt teach us ???? :confused:
well thnx for your time
Lee Macdonald
P.S I ADDed The Database file i want to write to thnx again bye
SwordFish_13
October 3rd, 2004, 06:59 PM
Hi,
A few Questions...
Are you working in Visual Basic or VB Script .......which verson?
What back-end you are planning to use ?..............what database Application?...........There are many ways with which you can connect to a database.
You can use ADODB or using ODBC or if you are making a database in MS-Access 97 and older you can use Jet Engine v4.
A bit more information after which i will be able to help you .
--Good luck--
dustybunny
October 3rd, 2004, 07:03 PM
hi,
i have MS VB 6 and i have MS access 2003
and i dont know what u mean by back-end :confused: i was never shown anything about this at college :(
well thnx for your time
i can upload a copie of the DB if that helps
THnx for your time lee
SwordFish_13
October 3rd, 2004, 07:33 PM
Hi,
Back End means the database Application ...:)..........in your case Visual basic is the Front -End and MS Access is the back end.
You can use both ADODB to connect to the MS-Acess 2003....
'Declare a connection and recordset object
Dim con as ADODB.Connection //the connection
dim rs As ADODB.Recordset //the recordset where the records from a
table are fetched
Private Sub Form_Load()
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data
Source= " & App.Path & "\test.mdb" //this connection string will not work with
MS-Access 2003 you will have to make your own..this is fro MS-Access 97
rs.Open "SELECT * From Customer", con, adOpenStatic, adLockOptimistic
this will fetch the records from the table customer into the recordset rs.......form there you can use them
Like for displaying the first record fetched by the recordset onot a text box names text1
text1.text=rs(0)
will show the record
To start with ..........try the ADODB Data Control ...........add that to your form and go to it's properties ................Follow the steps Select the type -> make connection string etc.
I don't have Visual Basic right now ...when i will get my hands on i will try to make you a sample application ........it's very hard to understand Vb this whay without a example application .........:)
Get a good book on visual basic it will help
Btw: I almost forgot to say Welcome to AO :hello:
--Good Luck--
dustybunny
October 3rd, 2004, 08:21 PM
THNX MATE
I STILL VERY LOST :(
BUT THANK YOU AT LEAST NOW I KNOW WHAT DIRECTION TO GO IN THANX