borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (ListBox Puzzle)Next Topic (Runtime Error 3061) New Topic New Poll Post Reply
AndreaVB Forum : Database : Coverting an MS access database
Poster Message
sai
Level: Guest


icon Coverting an MS access database

Hello

I want to convert an access database into the  VB standalone executable.

I started on 'VB Aplication Wizard' and found tat a bit confusing.

can u suggest some tutorials to convert access database into the  VB standalone executable.

Thanks for u r time and help

urs
sai

09-09-2004 at 01:11 AM
| Quote Reply
BRMC
Level: VB Lord


Registered: 28-11-2003
Posts: 210
icon Re: Coverting an MS access database

Hi,

u want to create an mdf ?
Or a program based on your access db?

I mean you use a mask report and so on  in your access db or u want to make a program that use your db?

In the first case u go to tools then database utility then create a mde file and your db start like an application , else u should create your form put your code and connect to the db.

Else in the vb application wizard , select your menus toolbar and so on when the program ask you if you want to make a form based on table ecc... you can click on create new form at the down right corner select your db and your  table select your way to display it and then click finish , the program is done!



Bye

____________________________
I don't mind not going to heaven
As long as they've got cigarettes
in hell

09-09-2004 at 08:06 AM
View Profile Send Email to User Show All Posts | Quote Reply
sai
Level: Guest

icon Re: Coverting an MS access database

Dear sir

Thanks for replying to my  to my query



I want to Create a stand alone, installable program capable of running under Windows 98/2000/XP and constraint is that the database format must not require the database
engine to be installed.

basically i want to make a access database into a VB install wizard program.

I have a access database which search for a particular recipe from the database. so now i want this to be converted into an installble program where the user can just install the vb program and then search stuff.

this would be helpful when the user doesn't have a access database installed.

it would be great if u can give some guidance on tat.

Thanks

urs
sai



[Edited by sai on 09-09-2004 at 04:54 PM GMT]   

[Edited by sai on 09-09-2004 at 04:54 PM GMT]

09-09-2004 at 04:49 PM
| Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: Coverting an MS access database

Some reflection points:

- in order to create a stand-alone executable file you need to 'compile' the programming language code, so you need an appropriate compiler. The bad news is that there are no existing compilers for MS Access files. It's an old question that periodically appears in the database's newsgroups, and I never read yet a positive answer.
Once I heard about the MS Office Developers Kit, but I've never seen it in action. I seem to remember that it includes a tool to export Access files in a stand-alone format (readable in any MSAccess-less machine), but I don't know how much this is true.

- if you only need to export Access data (say tables), and no forms or reports, there is a simpler solution:
you can create your executable program using VB, with its own forms, reading your external .mdb file through ADO (or DAO), and compile it. Then you can include the .mdb file into the setup pack, and this file will be read even in machines without Access. This is because ADO and DAO don't need Access to read an .mdb file, as they include the Jet engine - or some other engines - to open the db.
The only difference is you will have two separate files: the db and the executable. Of course all the other required files have to be included in the pack, but normally it's automatically done by the setup creation tool.

- if you add to your VB project a reference to MSAccess object, you can even execute some Access' specific operation, such as compacting/repairing the db, in machines without Access. You can check if Acces is installed in the target machine, and in this case you can run the forms and reports included into the .mdb. There are samples into the Tips section of this site, and you can find more searching around in the web.


Hope all this is useful

____________________________
Real Programmer can count up to 1024 on his fingers

12-09-2004 at 11:35 AM
View Profile Send Email to User Show All Posts | Quote Reply
sai
Level: Guest

icon Re: Coverting an MS access database

Dear yronium (VB Guru)

Thanks a lot for u r prompt reply.

That was great and useful.

I also want to include the forms from my access database.

the database I am using is available at

http://www.tamuk.edu/csc/mizhoney.zip

I got a good idea on how to approach that.

I am not that good in Vb as u must be .......can u pls suggest me some tutorial to go thru which wil make things a bit easy.

Thanks

urs
sai

13-09-2004 at 03:40 AM
| Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: Coverting an MS access database

I saw your db, and it's quite simple. You just had to reproduce three forms in VB, and that's I suggest. You just keep the tables into the .mdb file, create your own designed forms and include queries into the code (do you know that you can show the SQL instruction of each query by the View|SQL view menu, then copy it and paste into your VB project?). Finally you can compile your project and distribute both the .exe and the .mdb files. You can even pack them into a setup pack.

quote:
I got a good idea on how to approach that.

What this idea is?
quote:
can u pls suggest me some tutorial to go thru which wil make things a bit easy.

Tutorials... VB tutorials or Access tutorials? Anyway, you know, I started with Access. I was looking for a book to learn it, but I bought the wrong book. It was a developers book, so it was full of code-customized forms and reports. I studied it and made every exercise on it, and later I moved from VBA to pure VB.

This site has its own Tips section, and every VB site has it. You can just type 'Visual Basic', 'Visual Basic tutorial' or 'MS Access tutorial' into Google's search box and you'll got plenty of links to sites, and everyone has some tutorials into it for sure, so you can finally choose your favorite (just never mind the Microsoft sites' links, not easy for beginners. You'll go there later).

If you prefer books - I often read books - my favorite are Microsoft Press and McGraw Hill books. Some titles:
[MS Access]
- E. Callahan "Microsoft Access 97 Visual Basic Step by Step" - Microsoft Press (my first 'wrong' book, good to deepen Access knowledge and to introduce VBA)
[MS Visual Basic]
- M. Halvorson "Microsoft Visual Basic 6 Professional Step by Step" - Microsoft Press (for beginners)
- F. Balena "Programming Microsoft Visual Basic 6" - Microsoft Press (a complete course)
Books problem is they are expensive, but I like anyway keeping some books ready to consult.

Finally another wide information source is following the forums, like this, and the newsgroups.

Hope you'll find your way thru.
Keep in touch here.

____________________________
Real Programmer can count up to 1024 on his fingers
13-09-2004 at 12:27 PM
View Profile Send Email to User Show All Posts | Quote Reply
sai
Level: Guest

icon MS Access

Hey yronium

Once again thanks for replying back.

VB Guru I am sure it must be very simple for u but I
have to break my head some more before I get it.

I will start with the tutorials on the web and
"Microsoft Visual Basic 6 Professional Step by Step".
I used to read wrox publishers book by Beginning
Visual Basic 6 by Peter Wright.

I am really sorry that I didn't mention one main part
of my problem and want to know whether that's going to
be a big hinderance.

my set up pack should be like that we need not have the database engine into the system where I am installing.

So if I redesign the three forms in visual basic,
which are going to be Find form, enter parameter value
form ,  full recipe form. and then connect the
database tables into the vb form using ADO and then make it an exe.

then i will still need the access database to run the exe............ even if i pack exe and access  in a setup using the software install shield .......

so when i will be running the setup on a computer where MS Office is not installed will my program work.

I am sure the setup would need some kind of drivers to run the database with access not installed.

If it is not possible to run the exe without the access datbase installed.......

what is the best way to do that or will it work the way I told above.

I was also thinking if I can get all my data from access in to a flat file and then make changes in tat...........

Thanks for u r patience.............

urs
sai

13-09-2004 at 07:37 PM
| Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: MS Access

quote:
...then i will still need the access database to run the exe............

No, you won't need it. ADO includes the necessary engine.

You know, you can even rename the extension of the .mdb file: say, you can rename MizHoney.mdb to MizHoney.sai, and ADO will properly read it. The important thing is db's MS Jet 4.0 format, such as if you'd create a text file and rename it to .mdb neither Access nor ADO would read it.

Design your forms, add an ADO reference and an ADO control to easily browse the db, and that's all. Is enough to work even into Access-less machines. Try it.
If you need instruction on how to connect a db to VB controls, we will provide you.

____________________________
Real Programmer can count up to 1024 on his fingers
14-09-2004 at 03:26 PM
View Profile Send Email to User Show All Posts | Quote Reply
sai
Level: Guest

icon Re: Coverting an MS access database

Hey VBGuru


I have just started working on this. and did the following

http://www.tamuk.edu/csc/honey.zip

I am stuck on few things :

==> how to call the standard print command dialog box and the find command from visual basic form.

==> do i need to have a mdi form with child forms so that when I click a button on one form other form gets called.
how do we do that.



urs
sai

[Edited by sai on 15-09-2004 at 09:51 PM GMT]

15-09-2004 at 08:14 AM
| Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: Coverting an MS access database

quote:
I have just started working on this. and did the following...
I didn't see it yet, as I'm not at my pc now, and I have Access 97 and no VB here. I'll see it asap
quote:
how to call the standard print command dialog box [...] from visual basic form
You have to add a Windows Common Dialog control to your project, specifying it by the Project|References menu. It allows to call many standard Win32 dialog boxes, included Print and PrintSetup.
quote:
and the find command from visual basic form

Do you mean the Find (file or directories) window from the Start menu? Or a simple Find command to execute queries through your recordset?
quote:
do i need to have a mdi form with child forms so that when I click a button on one form other form gets called
No. An MDI form is a child form, that's contained into a parent form. Think at MS Word interface: it has a Main (parent) form, with menus and command bars, in which you can open several document windows (children), which you can arrange or bring to top by the main window's Window menu.
In your project you can use normal SDI forms, and keep open together all the ones you need. To open one form from inside another, just use the instruction
Private Sub btnOpenSecondForm_Click()
    frmMySecondForm.Show
End Sub


Hope it helps


____________________________
Real Programmer can count up to 1024 on his fingers
16-09-2004 at 08:03 AM
View Profile Send Email to User Show All Posts | Quote Reply
sai
Level: Guest

icon getting there

Hai yronium

Thank a lot for replying to my queries.

I tried to implement the print problem the way u told but it is not showing the dialog box. though there was a chunk of code i got from Microsoft website and was able to give the print job directly to the printer without showing the dialog.

also the displaying of records is stuck........

I tried implementing it using two methods and still getting the error "Couldn't Find Installable ISAM"

----------------------
Shady's  Method           http://www.tamuk.edu/csc/shady.zip
---------------------
---------------------
BRMC's Method             http://www.tamuk.edu/csc/brmc.zip
---------------------

I also have the following questions

don't know y can'nt i get that.

==> how can I get the Find and replace standard windows dialog box to be called on a button click?


==> If I want to make this into a install package what is the procedure to do tat?

lots of questions even after getting so much help but will surely understand if given a hint......

Thanks

Sai

18-09-2004 at 07:55 AM
| Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: Coverting an MS access database

quote:
==> how can I get the Find and replace standard windows dialog box to be called on a button click?

I'm afraid you can't. Find and replace window is an internal MS Access object, so you can include it into your project, but it won't work in Access-less machines.
If you want to provide your user a Find and Replace feature, you'd manage to build your own one by queries. Anyway, it shouldn't be that hard.
quote:
==> If I want to make this into a install package what is the procedure to do tat?
By 'this' do you mean the. mdb file? So, you just add it to the package creation project.
Or did you mean the whole VB project, in poor words 'how can I create a setup package'? This case, it depends on the tool you choose to work with.
You know, creation of a setup package it's not necessary, but is the simpler way to distribute your apps. The package creation tool manages all the DLLs/OCXs the project depends on, and allow developers to add some other files that they decide to include, such as your .mdb file.
There are many setup creation tools: the most common is the Package and Deployment Wizard (PDW), that's shipped with VB, but I prefer Visual Studio Installer (VSI) that creates smaller files and is more flexible. If you decide to try it, you have to download it by MS site. Both these are free. There are also some commercial ones, the most popular is InstallShield, but if I were you I'd wait to buy a commercial product.
In this forum we have discussed the 'installer' question several times, so if you search for 'installer' by site's search form, you'll get many useful threads to read.

quote:
...lots of questions even after getting so much help...
ehehehe...you're learning fast, isn't it? Well, you can't find better tutorial than striving to do a thing.

PS: again about Access distribution: I heard about MSDE but I don't know exactly what it is and does, nor if it could match your goal (so I beg other gurus opinions), as I never had the need to distribute any Access internal function before, Maybe you can have a look on it...

____________________________
Real Programmer can count up to 1024 on his fingers
18-09-2004 at 02:36 PM
View Profile Send Email to User Show All Posts | Quote Reply
sai
Level: Guest

icon Re: Coverting an MS access database

hey yronium

I am getting there.........

two questions if can answer them real quick

I am using this code to display my search result in the datagrid

-------------------------------------------
Set DataGrid1.DataSource = Nothing

Set DataGrid1.DataSource = Adodc1

Adodc1.RecordSource = "SELECT * FROM table1 WHERE txtRecipe like '*" & typeSearch & "*'"

'Adodc1.Refresh
--------------------------------------------

the above set of code displays the whole database in the datagrid and

if  I uncomment the Adodc1.Refresh it says syntax erro in from clause

I have set the connection string and also record source in the properties of data grid.

and it is not taking Adodc1.CommandText .

Thanks for the explaning the  'how to create a setup package'
in very clear and precise words. I know i made the question more difficult than it was.

Answer this if u think its ok to otherwise i will mess around with it some more.

Thanks VB Guru


urs
sai

19-09-2004 at 10:13 PM
| Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: Coverting an MS access database

(...Still not at my pc now, so I'm not sure if it's solving...)

quote:
Adodc1.RecordSource = "SELECT * FROM table1 WHERE txtRecipe like '*" & typeSearch & "*'"
The syntax error may be caused by the quotes. It often happens when it finds a record including quotes into a field value. Try replacing the single quote with the Chr(34) instruction, as following
Adodc1.RecordSource = "SELECT * FROM table1 WHERE txtRecipe Like " _
    & Chr(34) & "*" & typeSearch & "*" & Chr(34)

Hope it works, it's a good rule anyway.


____________________________
Real Programmer can count up to 1024 on his fingers
20-09-2004 at 11:10 AM
View Profile Send Email to User Show All Posts | Quote Reply
sai
Level: Guest

icon Last Module

Hey Yronium

It is working now

-------------------------------
Set DataGrid1.DataSource = Nothing

Adodc1.RecordSource = "SELECT * FROM table1 WHERE txtRecipe like  '%" & typeSearch & "%'"
  
Set DataGrid1.DataSource = Adodc1

Adodc1.Refresh

-------------------------------

then I also tried the Package and Deployment Wizard and it is working good.

I downloaded the Visual Studio Installer (VSI)  will check tat out tooo...........

then stuck with the last piece of code .......  

I want to implement the "find record" function as in the access ..............if not with all the functionalities but atleast some basic ............like find record by recipe name .

I created a form with a txt box , command button.

I want to display the records in the interface which i have created.........

if I use ADO then I will set the record source as above and then how can I set the textbox field to the corresponding field......

if I use the DAO the how can I use the SQL query string

a bit confused ........what would be the easiest way to attain this ...........

Thanks yronium................

if at all u r on u r system try clicking here and look at this junk

http://www.tamuk.edu/csc/honey.zip

urs
sai

21-09-2004 at 08:16 AM
| Quote Reply
sai
Level: Guest

icon give me a clue

Hey yronium

Thanks for u r support and answering my trvial questions.

Hopefully this is the last time I am bugging u.........

give me a clue

I want to make a "Find Next Record" in visual basic.......like the one we  have in MS Access

I have a interface where i am displaying my records and the string should also we highlighted when found.

I think the highlight can be achieved using timer.

I am having a tough time implmenting this.

any kind of help will be appreicated.

My code is here

http://www.tamuk.edu/csc/honey.zip


Thanks

urs
sai


[Edited by sai on 24-09-2004 at 06:19 AM GMT]

24-09-2004 at 06:19 AM
| Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: Coverting an MS access database

Just to apologize, sai
I'm a bit messy at the moment, and I'm never at my pc in my free time - ...well, I have effectively NO free time!... - so I didn't have the time to watch on your project. I hope you were able to walk it on, and I'll look on it asap.

____________________________
Real Programmer can count up to 1024 on his fingers

27-09-2004 at 08:42 AM
View Profile Send Email to User Show All Posts | Quote Reply
sai
Level: Guest

icon Thanks

Hey yronium

I don't expect u to do every bit of coding for me.

All u r tips and guidance was great.........

Tat made my life easy.

Thanks.

urs
sai

27-09-2004 at 06:19 PM
| Quote Reply
sai
Level: Guest

icon Thanks

Hey yronium


All u r tips and guidance was great.........

Tat made my life easy.

Thanks.

urs
sai

[Edited by sai on 27-09-2004 at 06:20 PM GMT]

27-09-2004 at 06:19 PM
| Quote Reply
AndreaVB Forum : Database : Coverting an MS access database
Previous Topic (ListBox Puzzle)Next Topic (Runtime Error 3061) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder