Opening forms report in ADP from MDB automatically

G

Guest

I using an ADP as a main front end, sql server as database house and
MDB as temp import. Currently right now, i have it user click on button and
the MDB opens up, but it is hidden (don't want them to see the process of
import) and then after import, it closes itself (MDB). I need a way before it
closes it self, to open up a form in ADP and then closes it self. Wonder if
it is possible

also, wonder if there is a way that the MS access splashscreen doesn't show
up with teh MDB opens. thanks
 
T

Tim Ferguson

Currently right now, i have it user click on button and
the MDB opens up, but it is hidden (don't want them to see the process
of import) and then after import, it closes itself (MDB). I need a way
before it closes it self, to open up a form in ADP and then closes it
self. Wonder if it is possible

Why open the mdb at all?

Your adp can create an empty mdb file, create empty tables in it to do to
the import and then delete the file afterwards without any GUI involvement
at all.

Just a thought...


Tim F
 
G

Guest

how can this be done

Tim Ferguson said:
Why open the mdb at all?

Your adp can create an empty mdb file, create empty tables in it to do to
the import and then delete the file afterwards without any GUI involvement
at all.

Just a thought...


Tim F
 
T

Tim Ferguson

how can this be done
I am no expert in ADO, but this is a bit of a procedure that I wrote some
time ago. You can use the principles for your needs:

Public Sub MakeForeignData()

Dim cat As ADOX.Catalog
Dim conn As ADODB.Connection
Dim strSQL As String
Dim dwRecordsAffected As Long

Const FilePath = "c:\temp\temporary.mdb"
' this is just a safe way of deleting a given file
ClearFile FilePath

' Create a catalog
Set cat = CreateObject("ADOX.Catalog")
' and use it to create a new mdb file
cat.Create "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FilePath
' retain a handle to the connection to the new database
Set conn = cat.ActiveConnection

' create a table to hold the new data
strSQL = "CREATE TABLE Test " & vbCrLf & _
"( TestID AUTOINCREMENT " & vbCrLf & _
" CONSTRAINT pk PRIMARY KEY, " & vbCrLf & _
" Textfield VARCHAR(20) NOT NULL " & vbCrLf & _
" DEFAULT ""-""" & vbCrLf & _
")"

' and check that it looks alright
Debug.Assert strSQL

' You'll need to detect any errors in the SQL rather than letting
' the whole procedure die.
On Error Resume Next
' and now try the create command itself
conn.Execute strSQL, dwRecordsAffected, adCmdText + adExecuteNoRecords

If Err.Number <> 0 Then
Debug.Print Err.Number & ": " & Err.Description
Err.Raise 2

Else
Debug.Print "OK"

End If

' do something useful here, like fill up the table or link it
' to something else etc, etc, etc.

' then tidy up
conn.Close

' all over

End Sub
 

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