Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does an access db in an app req user to have access?

Status
Not open for further replies.

Bubbler

IS-IT--Management
Dec 14, 2003
135
US
If I use an access db in an app, does it require the user that installs the app to MS Access installed or can the app still perform browse, search, delete and add record functions without it? Or do I need to include a certain file (Mdac, dll or something)
 
You will need to ensure that MDAC is installed.
Windows 95 at least will not allow THAT installed unless DCOM is also installed.

Access itself is not required.
 
When you create your App's setup, it should search for all the propper references that you need to run all of your objects/controls

In other words, make sure that your setup includes the MS ADO data objects library when you create the setup.

Setup will then install the access driver when your app installs and the user will not need to have access to run your app.

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
So I would be better in this case to use a txt file to store data, it will only carry approx 10 to 50 single line entries of approx 50 chars per line.

I know all of the add record, del record etc code for working with an access db but am not the best with txt files and freefile code.
If I use a txt file, like I mentioned, the data is single line and very light, I will want to add ne lines, delete existing and display the list in a text box or listbox.
Anyone know of a good resource for this info, or a good search term for info?
Also what are you feelings on this method all together? DO you think it is a good solution? As I said, the data will be VERY light.
 
If you are showing the data in a listbox, then (in general terms)

Load the whole file into your list box at startup.
Make any changes you new (add, new, delete) in the listbox
Save the listbox contents back to a text file on close.
 
I would say that you should stay with access.

Reading a textfile can sometimes be difficult, concerning soaces and commas, and an access DB is much more robust than a textfile when replacing and addind data in a specific line(record).

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
Thanks for your input, I think I will go with the txt file because I do not want the user to have to have access. The functions I am going to do are very light, here is the way I am manipulating it. Feel free to give me any pointers on how to make this code better. I mean, it works but sometimes I do not see the best or cleanest way to do things :)



Private Sub Form_Load()
fname = "C:\file.txt"
Open fname For Input As #1
Do
Input #1, temp
List1.AddItem (temp)
Loop Until EOF(1)
Close #1
Exit Sub
End Sub

Private Sub cmdSave_Click()
fname = "C:\file.txt"
Open fname For Output As #1
For N = 0 To List1.ListCount - 1
temp = List1.List(N)
Write #1, temp
Next N
Close #1
End Sub

Private Sub cmdAddItem_Click()
'add txtAdd's entry to the list
List1.AddItem txtAdd
End Sub

Private Sub cmdDelete_Click()
'remove the selected item from the list
List1.RemoveItem Index
End Sub
 
The user doesn't need Access. It's a Jet database that you're using, and Access is only one sort of front end for it. You can just as easily use a VB front end for a Jet DB using either DAO or ADO

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
oh oh :-(
It seems that
Code:
List1.RemoveItem Index
does not remove the selected item, it removes the top one in the list.
 
Bubbler, have you read my first post?

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
From johnwm "You can just as easily use a VB front end for a Jet DB using either DAO or ADO "

So if I understand John, if I use the data connection ctrl in the tool box (that's ADO right?) then the user does not need access?
 
x508, I did read it but was still unsure becasue of JeffTullin's post previous to it.
 
Are my posts invisible?

Can anyone read this???

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
Bubbler,

as x508 and John indicate you can use a JET database (.mdb) even if access is not installed. you only have to install MDAC but the catch, as Jeff says, is that win95/98 will also need DCOM installed. Why don't you try it yourself? I am sure you can find a pc without access. Then install MDAC and your app.
 
We all seem to be posting at the same time here!

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Bubbler

Do you understand about access and the Jet driver now?

If not, we can still explain...

My feelings are that if you just use words that you want to store in the textfile, then do it.

The moment you start storing sentences, you will almost definately experience problems

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
I basically get the Jet Driver, and I will research it further now.
The one thing that is bugging me though is why
Code:
List1.RemoveItem Index
removes the first item in a list box, not the selected one.
when you hit the space bar after
Code:
List1.RemoveItem
it pops up
Code:
RemoveItem(Index As Integer)
 
Use:

List1.RemoveItem List1.ListIndex

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
Thank you all. I need a good vb book [dazed]
I think I will head off to the local book store tomorrow, something I should have done a while ago, seeing that I live in Las Vegas it won't be hard to find a whole pile, any suggestions anyone?

Your all probably cheering now :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top