944,188 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Jul 2nd, 2007
0

EXCEL as a Database

Expand Post »
I know theres a menu button for it somewhere but i cant seem to remember how to do it.

This is for my movie information Database (I dont know if any of you remember when I was asking about storing the data in a txt file. Well now I am trying to get it in a EXCEL document. Any help would be appreciated.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
t3hfr3ak is offline Offline
22 posts
since Apr 2007
Jul 2nd, 2007
0

Re: EXCEL as a Database

Hi,

For those of us who don't remember what are you trying to do ?

Denis
Reputation Points: 22
Solved Threads: 19
Posting Whiz
DenisOxon is offline Offline
345 posts
since Jan 2007
Jul 2nd, 2007
0

Re: EXCEL as a Database

Click to Expand / Collapse  Quote originally posted by DenisOxon ...
Hi,

For those of us who don't remember what are you trying to do ?

Denis
I am making a movie information program Which has 3 forms

Form 1: The Main form where it tells you basic info about the program and 3 command buttons.

Form 2: Used to enter the information about the movie into text boxes to save into a file for later use

Form 3: Used to view the information entered previously
Reputation Points: 10
Solved Threads: 0
Newbie Poster
t3hfr3ak is offline Offline
22 posts
since Apr 2007
Jul 3rd, 2007
0

Re: EXCEL as a Database

Hi,

Check This Code:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub cmdOpenExcel_Click()
  2. '
  3. Dim ACn As New ADODB.Connection
  4. Dim RST As New ADODB.Recordset
  5. '
  6. With ACn
  7. .Provider = "Microsoft.Jet.OLEDB.4.0"
  8. .ConnectionString = "Data Source=C:\MyExcel.xls ;Extended Properties=Excel 8.0;"
  9. .CursorLocation = adUseClient
  10. .Open
  11. End With
  12. '
  13. SET RST =Nothing
  14. RST.Open "select * from [XL_SHEETNAME]", ACn, adOpenDynamic, adLockReadOnly
  15. Do While Not RST.EOF
  16. Debug.Print RST(0)
  17. RST.MoveNext
  18. Loop
  19. RST.Close
  20. ACn.Close
  21. '
  22. End Sub


Regrads
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Jul 3rd, 2007
0

Re: EXCEL as a Database

hmm... that honestly doesnt make too much sense too me... care to elaborate?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
t3hfr3ak is offline Offline
22 posts
since Apr 2007
Jul 4th, 2007
0

Re: EXCEL as a Database

Hi,

i thought u wanted to connect to Excel thru "ADO" onnection..


Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Jul 4th, 2007
0

Re: EXCEL as a Database

no i want to write and read variables to a spreadsheet
Reputation Points: 10
Solved Threads: 0
Newbie Poster
t3hfr3ak is offline Offline
22 posts
since Apr 2007
Jul 5th, 2007
0

Re: EXCEL as a Database

hi,

'declare the objects for connection and recordset
Dim con As ADODB.Connection
Dim rst As ADODB.Recordset

'Create object for connection
Set con = CreateObject("ADODB.Connection")
strcon = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\ioc\excel\ioc.xls;" & _
"Extended Properties=Excel 8.0;"

'apply connection string
con.ConnectionString = strcon

'Open the Connection
con.Open

'Create object for recordset
Set rst = New ADODB.Recordset

'Exp i use table employee
rst.Open "select * from employee", con, adOpenDynamic, adLockOptimistic

'To add a record
rst.AddNew
rst(0) = Trim(Combo1.Text)
rst(0) = Trim(Text2.Text)
rst(2) = Trim(Text1.Text)
rst.update

Same thing for search,update and delete records. Try this coding

al the best
shailu
Reputation Points: 34
Solved Threads: 10
Junior Poster
manoshailu is offline Offline
105 posts
since Jun 2007
Jul 5th, 2007
0

Re: EXCEL as a Database

Click to Expand / Collapse  Quote originally posted by t3hfr3ak ...
I am making a movie information program Which has 3 forms

Form 1: The Main form where it tells you basic info about the program and 3 command buttons.

Form 2: Used to enter the information about the movie into text boxes to save into a file for later use

Form 3: Used to view the information entered previously
Hi,

A question about each form

1) what are three buttons for ?

2) what file are you going to save them into ?


3) Is this displaying a spreadsheet ?

Denis
Reputation Points: 22
Solved Threads: 19
Posting Whiz
DenisOxon is offline Offline
345 posts
since Jan 2007
Jul 5th, 2007
0

Re: EXCEL as a Database

I know theres a none code way to do it if you follow buttons in VB. I was doing it before there was a "Create database using excel or foxpro or access or a text file ect.

1) The three buttons are on the MAIN form.
Button 1. Displays the input form to enter movie info and store the variables to a text file (I would like to store them to an excel file)
Button 2. Displays the form where you pick a movie and it will display on the information about the movie
Button 3. Closes the project

3) No it does not display a spreadsheet, I just want it to take the variables FROM the spreadsheet and throw them in a few labels.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
t3hfr3ak is offline Offline
22 posts
since Apr 2007

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: GetChunk() and AppendChunk() in vb 6.0
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Filter using Binding Source





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


Follow us on Twitter


© 2011 DaniWeb® LLC