EXCEL as a Database

Reply

Join Date: Apr 2007
Posts: 22
Reputation: t3hfr3ak is an unknown quantity at this point 
Solved Threads: 0
t3hfr3ak t3hfr3ak is offline Offline
Newbie Poster

EXCEL as a Database

 
0
  #1
Jul 2nd, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 319
Reputation: DenisOxon is an unknown quantity at this point 
Solved Threads: 15
DenisOxon's Avatar
DenisOxon DenisOxon is offline Offline
Posting Whiz

Re: EXCEL as a Database

 
0
  #2
Jul 2nd, 2007
Hi,

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

Denis
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 22
Reputation: t3hfr3ak is an unknown quantity at this point 
Solved Threads: 0
t3hfr3ak t3hfr3ak is offline Offline
Newbie Poster

Re: EXCEL as a Database

 
0
  #3
Jul 2nd, 2007
Originally Posted by DenisOxon View Post
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: EXCEL as a Database

 
0
  #4
Jul 3rd, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 22
Reputation: t3hfr3ak is an unknown quantity at this point 
Solved Threads: 0
t3hfr3ak t3hfr3ak is offline Offline
Newbie Poster

Re: EXCEL as a Database

 
0
  #5
Jul 3rd, 2007
hmm... that honestly doesnt make too much sense too me... care to elaborate?
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: EXCEL as a Database

 
0
  #6
Jul 4th, 2007
Hi,

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


Regards
Veena
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 22
Reputation: t3hfr3ak is an unknown quantity at this point 
Solved Threads: 0
t3hfr3ak t3hfr3ak is offline Offline
Newbie Poster

Re: EXCEL as a Database

 
0
  #7
Jul 4th, 2007
no i want to write and read variables to a spreadsheet
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 95
Reputation: manoshailu is an unknown quantity at this point 
Solved Threads: 9
manoshailu's Avatar
manoshailu manoshailu is offline Offline
Junior Poster in Training

Re: EXCEL as a Database

 
0
  #8
Jul 5th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 319
Reputation: DenisOxon is an unknown quantity at this point 
Solved Threads: 15
DenisOxon's Avatar
DenisOxon DenisOxon is offline Offline
Posting Whiz

Re: EXCEL as a Database

 
0
  #9
Jul 5th, 2007
Originally Posted by t3hfr3ak View Post
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 22
Reputation: t3hfr3ak is an unknown quantity at this point 
Solved Threads: 0
t3hfr3ak t3hfr3ak is offline Offline
Newbie Poster

Re: EXCEL as a Database

 
0
  #10
Jul 5th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC