944,004 Members | Top Members by Rank

Ad:
Mar 2nd, 2005
0

Access and VB

Expand Post »
this is ganna sound so weired. do anyone happend to have any worksheet about access and vb, and creating database, please send me a private email on yahoo, tansk
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
baboon4000 is offline Offline
18 posts
since Mar 2005
Mar 6th, 2005
0

Re: er

Hi,
I don't know exactly what you want to do here.
Do you want to create a database or table using vb?

If thats the case, I think you can make are reference first to ms access 8.0 if your using access97 then create an object...

It's really hard to guess but hope it gives you some help.


Newvbguy
Reputation Points: 13
Solved Threads: 3
Junior Poster in Training
NewVBguy is offline Offline
71 posts
since Mar 2005
Mar 17th, 2005
0

Re: er

Hi, do you wnat to just access and an "access" database using vb, or create your own in vb?
which versions are you using?
Reputation Points: 49
Solved Threads: 11
Posting Whiz in Training
uniquestar is offline Offline
239 posts
since Feb 2005
Mar 22nd, 2005
0

Re: Access and VB

Quote originally posted by baboon4000 ...
this is ganna sound so weired. do anyone happend to have any worksheet about access and vb, and creating database, please send me a private email on yahoo, tansk
its looking that u need to create database on ms access (2000) and wan to connect forms with it...u can choose ODBC (control panel --> Admins. Tools --> ODBC) and then write file source...use wizards in VB 6..it will be easier for u
kh(bye)

Raza.
hasnainr1@yahoo.co.uk
hasnainr1@hotmail.com
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Raza is offline Offline
18 posts
since Mar 2005
Apr 11th, 2005
0

Re: Access and VB

First go to access and creat a database for example database name is "Test". Then creat a table having some name for example "Invoice_info", having some field according to ur requirment.
Then come on to VB6 and select VB Enterprise Control Application form place as many textboxes as u've fields in ur table.
For example ur table has 4 fields
invoice(string)
Name(String)
Date(dateandtime type)
Amount(Number)
Create 4 textboxes for each field. And 2 command buttons 1 for save the record and 1 for retreive the record.
Then past Adodc on ur VB Form. and palces these lines of code
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Test.mdb;Persist Security Info=False"
End Sub

Private Sub retrieve_Click()
Unload Form1
Load Form1
Form1.Show

Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "Invoice_info"
Adodc1.Refresh


Text1.Text = Adodc1.Recordset.Fields(0)
Text2.Text = Adodc1.Recordset.Fields(1)
Text3.Text = Adodc1.Recordset.Fields(2)
Text4.Text = Adodc1.Recordset.Fields(3)


End Sub

Private Sub save_Click()
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "Invoice_info"
Adodc1.Refresh

Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields(0) = Text1.Text
Adodc1.Recordset.Fields(1) = Text2.Text
Adodc1.Recordset.Fields(2) = Text3.Text
Adodc1.Recordset.Fields(3) = Val(Text4.Text)
Adodc1.Recordset.Update
Unload Form1
Load Form1
Form1.Show
End Sub

Note that the database must be at the location where the VB application is. Means the VB application and Access Data base must be in same folder.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mohsin Khan is offline Offline
8 posts
since Apr 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Add a name in the TO: address with code
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Need real time in XP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC