Converting an existing MS access form to a VB project???

  • Thread starter chris23892 via AccessMonster.com
  • Start date
C

chris23892 via AccessMonster.com

Here's a thought..And I'm not sure this is even possiable...

I was putzing around with visual studio 2008. I did something very cool last
night. I took my VB code I had created in one of my MS access applications
and pasted the code into my VB studio project and built a windows application.
Worked like a charm.

Here's my question:

I have an entire form from one of my MS acess projects. How would I go about
reproducing this in VB studio? I would need to point to my database path
(some of the buttom functions execute script that depends on querries in this
project). My custom code is already in access, but to get this to work in an
application, I need to figure out how to tell the application where my MS
access mdb is at so it can utalize the querries in it.

Any thoughts or suggestions?
 
C

chris23892 via AccessMonster.com

Aww....after some more research, seems I just need to figure out how to
establish a back door connection to my .mdb in my VB project. I'm assuming
once I establish the connection, the rest of my scripts should work?

Here's an example of what one of my buttoms do on my ACCESS FORM: Note that
this is running WITH IN acess, so access knows where everything is at.

Private Sub Command1_Click()
Dim sXL As String, oXL As Object
sXL = "\test1.xls" 'Full path to your spreadsheet
' Insert the actual name of your query between the quotes below
DoCmd.TransferSpreadsheet acExport, , "whats_been_closed", sXL
Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
oXL.WorkBooks.Open FileName:=sXL
End Sub
 
S

Sylvain Lafontaine

From reading your two posts, it's hard to know what you are trying to do.
If you simply want to learn how to manipulate databases (Access, SQL-Server,
etc.) from a VB.NET application, look at the videos under the sections
"Forms over Data Video Series" and "Visual Basic 2008 Forms over Data
Videos" from Beth Massi at the following page:

http://msdn.microsoft.com/en-us/vbasic/bb466226.aspx

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain aei ca (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 
C

chris23892 via AccessMonster.com

Thanks for the input. I'll start simple and explain what I am thinking of
here...


I've created a form in MS Acess 2003. This form has buttons that runs all
kinds of querries and exports these querries to spreadsheets. Very cool,
works great. My main objective is to do the EXACT same thing, but in a VB
project so it can run as a stand along .exe app.

So, lets break this down in very small baby steps...

Task #1

1.) How in the world does one connect to the back end of an existing MS
access database in VB? I can certainly code my buttoms in VB, but without
telling VB anything about my database, the buttons will be useless in my VB
project.

I first need to code a connection to my existing database.









Sylvain said:
From reading your two posts, it's hard to know what you are trying to do.
If you simply want to learn how to manipulate databases (Access, SQL-Server,
etc.) from a VB.NET application, look at the videos under the sections
"Forms over Data Video Series" and "Visual Basic 2008 Forms over Data
Videos" from Beth Massi at the following page:

http://msdn.microsoft.com/en-us/vbasic/bb466226.aspx
Aww....after some more research, seems I just need to figure out how to
establish a back door connection to my .mdb in my VB project. I'm assuming
[quoted text clipped - 36 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top