ADO

G

Guest

Hi. I am trying to use either of the following functions in my FE to open a
connection to my BE to delete a table. If I step thru my application crashes
or if i run it I get a error mesage like "function not working properly,
would you like to repair it ". Is my ADO bad?

Dim objAcc As Application
Set objAcc = CreateObject("access.application")
objAcc.OpenCurrentDatabase ("L:\GROUPS\Funds\NonPropBE.MDB")
objAcc.DoCmd.DeleteObject acTable, "tblAIMBackup"
objAcc.CloseCurrentDatabase

OR

Dim objAcc As New Access.Application
With objAcc
.OpenCurrentDatabase "L:\GROUPS\Funds\NonPropBE.MDB"
.DoCmd.DeleteObject acTable, "tblAIMBackup"
.CloseCurrentDatabase
End With
 
G

Guest

Give the following a try

Dim appAccess As Application
Dim db As Database

Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase "L:\GROUPS\Funds\NonPropBE.MDB"
Set db = appAccess.CurrentDb
db.TableDefs.Delete "tblAIMBackup"

Set db = Nothing
appAccess.Quit
Set appAccess = Nothing

Hope This Helps
Gerald Stanley MCSD
 
G

Guest

Hi Gerald. Thanks for replying. That didn't work for me. I got an error
mesage "An error occured and this feature is no longer functioning properly,
would you like to repair this feature now?" According to MS, i think I need
to install an office service release. Do you concurr?
 
G

Guest

It is always advisable to make sure that you have the most recent service
packs installed. I tested the code on my machine(A2K3 SP1) before I posted
it and it worked fine.

Hope This Helps
Gerald Stanley MCSD
 
G

Guest

I tried the code as well and received error code 3281.

Isn't there a demo that shows how to view external .mdb data in a listbox or
so ?
 

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