| | |
EXCEL as a Database
![]() |
•
•
Join Date: Apr 2007
Posts: 22
Reputation:
Solved Threads: 0
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.
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.
•
•
Join Date: Apr 2007
Posts: 22
Reputation:
Solved Threads: 0
•
•
•
•
Hi,
For those of us who don't remember what are you trying to do ?
Denis
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,
Check This Code:
Regrads
Veena
Check This Code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub cmdOpenExcel_Click() ' Dim ACn As New ADODB.Connection Dim RST As New ADODB.Recordset ' With ACn .Provider = "Microsoft.Jet.OLEDB.4.0" .ConnectionString = "Data Source=C:\MyExcel.xls ;Extended Properties=Excel 8.0;" .CursorLocation = adUseClient .Open End With ' SET RST =Nothing RST.Open "select * from [XL_SHEETNAME]", ACn, adOpenDynamic, adLockReadOnly Do While Not RST.EOF Debug.Print RST(0) RST.MoveNext Loop RST.Close ACn.Close ' End Sub
Regrads
Veena
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
'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
•
•
•
•
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
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
•
•
Join Date: Apr 2007
Posts: 22
Reputation:
Solved Threads: 0
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.
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.
![]() |
Similar Threads
- copy data from excel to vb database (Visual Basic 4 / 5 / 6)
- read excel records in asp not refreshing (is the excel file cached) (ASP)
- Excel to ASP database (ASP)
- ASP - Excel to Database (ASP)
- excel as VB database (Visual Basic 4 / 5 / 6)
- excel database linking with vb.net (VB.NET)
- Import info from excel to access (MS Access and FileMaker Pro)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: GetChunk() and AppendChunk() in vb 6.0
- Next Thread: Filter using Binding Source
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





