|
-
Aug 31st, 2001, 12:58 PM
#1
Thread Starter
Fanatic Member
Organizing data so its easy to get.
My problem is retrieving data from a database.
I really don't know all the available otions to me.
So i created a Access database to just function as a storage device.
I know the are better ways to organize data so it is easily accessed..
Does anyone Know where I should start..
Here is samlpe code of me accessing access..
VB Code:
Public Sub GetElectricsCosts()
Dim rstElect As Recordset ' record set variable
Dim i As Integer
Set DbsVacublast = OpenDatabase(PATH) 'setting database object var
Set rstElect = DbsVacublast.OpenRecordset("ElectPanel")
rstElect.Index = "PrimaryKey"
rstElect.Seek "=", m_floorConfiguration
For i = 0 To 2
m_ElectCost(i) = rstElect(i + 1)
Next i
rstElect.Close
DbsVacublast.Close
End Sub
-
Aug 31st, 2001, 03:49 PM
#2
Code:
Public Sub GetElectricsCosts()
Dim rstElect As Recordset
Dim i As Integer
Set DbsVacublast = OpenDatabase("C:\Path\aDatabaseFile.mdb")
Set rstElect = DbsVacublast.OpenRecordset("SELECT * FROM TableName WHERE ColumnName = '" & searchstring & "'")
End Sub
If you are just trying to look up a value, take a look at SQL or SELECT querties in the access / vb help files. The above gives the general idea, but if you don't get it, please ask.
Note though - I've put single quotes in there. To show this, I'll put spaces in the below, but to get the string to work okay, you'll need to take these out again :
Code:
ColumnName = ' " & searchstring & " ' " )
Cheers
-
Aug 31st, 2001, 03:54 PM
#3
Thread Starter
Fanatic Member
From VB
How would I create a createtable query, and then from that table pull the information I want all at once..
See, prblem is that I am connecting 10 time all at the same time..to get required data..
Follow????
I know what I want to do.. just I have no idea where I should start learning.
SeaHag
-
Sep 4th, 2001, 02:24 AM
#4
seahag, have you got maybe a small databse you could send with instructions on what you need, not 100% sure what you're after, have a faint idea, but if it's possible it'd be better if you could send an example.
Cheers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|