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 (Extract SQL for a table definition)Next Topic (search access database) New Topic New Poll Post Reply
AndreaVB Forum : Database : import in VB some forms from Access
Poster Message
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907

icon import in VB some forms from Access

Hello y'all. I'm aware I discouraged somebody, not long ago, to try an Access conversion, but my problem is a little different today.

I have an .mdb file (MS Access 97 made), containing about ninety forms. It works standalone perfectly. It provides also data to an .exe file made in VB.
I would like to export all the existing forms into the VB .exe, leaving only the tables in the .mdb.

Is it possible? How? Is it a VB feature or an Access feature? I can even convert it in MSAccess2k before. Is it any useful?

Thank you all in adavance.

____________________________
Real Programmer can count up to 1024 on his fingers

02-11-2004 at 03:04 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: import in VB some forms from Access

Hi,
As far as I am aware there is no available import/export function either within VB or Access. The problem here is that they both use different forms generators, so they cannot be easily converted. Also, because Access locks all the Forms generation code away in the mdb you cann't even cut and paste into a text editor and then rename it as a "frm" file.
It is entirely possible that there is a third-party solution out there somewhere, but I have not yet found one.
If you do find a way then let me know, 'cos I also have a very large mdb application that I would love to put into VB.NET.
There is some light out there though. If you have loads of Reports in the mdb and you fancy moving the database into SQL-Server (for which there IS an upgrade Wizard) then the new SQL-Server Reports Server will import Access reports!


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

02-11-2004 at 03:44 PM
View Profile Send Email to User Show All Posts | Quote Reply
Killazzz
Level: Guest

icon Re: import in VB some forms from Access

Hello,

It is actually possible to do just that. Just write a program in access that loops all forms in the MDB.

For each form you loop the controls and their properties. The control data can be written to a text file. Save the text file as .frm and import it into VB.

To get an idea of how an frm looks like, just open one in notepad.

It's quite easy to write a form generator that way.

Kind regards,

Jason

04-11-2004 at 07:20 PM
| Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: import in VB some forms from Access

Thats pretty cool Jason..
Never thought of that way.
Isn't it strange how sometimes when you think that a solution to a problem is difficult it turns out to be quite easy!
Mind you, that works the other way round too

____________________________
multi-tasking - the ability to hang more than one app. at the same time.

05-11-2004 at 08:43 AM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: import in VB some forms from Access

Yeah, I thought about this kind of approach. But is it really enough? Does it work also with VBA code? I know that some properties/methods/events are not existant in pure VB. I should have to convert all the methods and events into pure VB, and I have to do it for about ninety forms. So is there any tool?

____________________________
Real Programmer can count up to 1024 on his fingers

05-11-2004 at 03:06 PM
View Profile Send Email to User Show All Posts | Quote Reply
Killazzz
Level: Guest

icon Re: import in VB some forms from Access

You have to do this for all events/properties/(methods) on one form and then run it 90 times.

It all depends on the difficulty of the forms I guess. If you use functions and modules then you could just import that into a .bas in VB. I think you can save the modules in Access as .bas not sure though.

Geoffs : What do you mean with the other way round ? Could one write a form in VB and save it into access ? That would be interesting. What I have done once is write all control-data in a table and then generate forms out of that. You can use this to do the basic layout of a form. It saves you a lot of time/money. My company is developing such a generator for c# code. I actually have a IT engineer working as a trainee to do this :-)

07-11-2004 at 11:04 AM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: import in VB some forms from Access

quote:
Isn't it strange how sometimes when you think that a solution to a problem is difficult it turns out to be quite easy!


I think what Geoff meant is that sometimes a solution that would appear simple turns out to be quite difficult.



Steve  

[Edited by steve_w on 07-11-2004 at 01:54 PM GMT]
07-11-2004 at 01:53 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: import in VB some forms from Access

That's exactly what I meant Steve.   
Hey, Jason - I wish I had a trainee doing all my boring stuff



[Edited by GeoffS on 09-11-2004 at 09:13 AM GMT]

____________________________
multi-tasking - the ability to hang more than one app. at the same time.

09-11-2004 at 09:12 AM
View Profile Send Email to User Show All Posts | Quote Reply
macrowriter
Level: Big Cheese

Registered: 27-10-2004
Posts: 19
icon Re: import in VB some forms from Access

I wrote vers similar code to convert DataEase forms into access forms... and tables.

The only issue I found was that the layout had to be re-arranged as I was converting a text printout (.prn) temp file to a looped control generator.

However, each control should record its postiion so if you have this data also, (I didnt), it is entirely possible to convert either way.

I bet if you looked hard enough on the web youll find somone has created a utility to do just that - and maybe even create asp etc.

Its a nice challenge to do though - and just a little grind analysis the propertys of the controls and conversion scripts.

[Edited by macrowriter on 24-11-2004 at 06:47 PM GMT]

24-11-2004 at 06:46 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : import in VB some forms from Access
Previous Topic (Extract SQL for a table definition)Next Topic (search access database) 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