By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,676 Members | 1,708 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,676 IT Pros & Developers. It's quick & easy.

Used SQL Upsizing Wizard, Application No Longer Runs

P: n/a
Excuse any errors in my description of the problem, as I'm only an
amateur with Access.

I've just created a simple VB application in A2000 that imports a text
file into a table, and works fine. I then used the Microsoft Upsizing
Wizard to create a new SQL database with an MS Access 2000 back end,
and guess what, it not longer works, but stops at the line

db.TableDefs.Delete ("tblData")

The code to the point where it 'stops' is as follows:

Dim objFile As TextFile
' Create new instance of TextFile class
Set objFile = New TextFile
' Set the Path property
objFile.Path = Trim(strDataInputFile.strFile)
strDataOutputFile = "c:\acag\temp\" & Mid(strDataInputFile.strFile, 15,
Len(Trim(strDataInputFile.strFile)) - 14)
Open strDataOutputFile For Output As 1
strDataErrorFile = "c:\acag\temp\Errors_Data.txt"
Open strDataErrorFile For Output As 2
Dim db As Database
Dim rstData As Recordset
Set db = CurrentDb
' delete previous table
db.TableDefs.Delete ("tblData")

Can anyone put me on the right track please.

-cicada-

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"-cicada-" <jo********@a1.com.au> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Excuse any errors in my description of the problem, as I'm only an
amateur with Access.

I've just created a simple VB application in A2000 that imports a text
file into a table, and works fine. I then used the Microsoft Upsizing
Wizard to create a new SQL database with an MS Access 2000 back end,
and guess what, it not longer works, but stops at the line

db.TableDefs.Delete ("tblData")

The code to the point where it 'stops' is as follows:

Dim objFile As TextFile
' Create new instance of TextFile class
Set objFile = New TextFile
' Set the Path property
objFile.Path = Trim(strDataInputFile.strFile)
strDataOutputFile = "c:\acag\temp\" & Mid(strDataInputFile.strFile, 15,
Len(Trim(strDataInputFile.strFile)) - 14)
Open strDataOutputFile For Output As 1
strDataErrorFile = "c:\acag\temp\Errors_Data.txt"
Open strDataErrorFile For Output As 2
Dim db As Database
Dim rstData As Recordset
Set db = CurrentDb
' delete previous table
db.TableDefs.Delete ("tblData")

Can anyone put me on the right track please.

-cicada-


What error do you get? Does tblData exist and if so, is it a linked table?
Or perhaps you are trying to delete the actual SQL Server table, rather than
the Access linked table.
Nov 13 '05 #2

P: n/a
Brian,

The error message is 'Path Not Found'

Yes, tblData does exist. In MS Access it shows in the Database window
under the table tab, but does not have the arrow next to it, to
indicate it is a linked table, as is usually the case. The table is
also listed in the SQL database, so having it listed in two databases,
without any indication of linking has confused me.
John Furphy

Brian Wilson wrote:
"-cicada-" <jo********@a1.com.au> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Excuse any errors in my description of the problem, as I'm only an
amateur with Access.

I've just created a simple VB application in A2000 that imports a text
file into a table, and works fine. I then used the Microsoft Upsizing
Wizard to create a new SQL database with an MS Access 2000 back end,
and guess what, it not longer works, but stops at the line

db.TableDefs.Delete ("tblData")

The code to the point where it 'stops' is as follows:

Dim objFile As TextFile
' Create new instance of TextFile class
Set objFile = New TextFile
' Set the Path property
objFile.Path = Trim(strDataInputFile.strFile)
strDataOutputFile = "c:\acag\temp\" & Mid(strDataInputFile.strFile, 15,
Len(Trim(strDataInputFile.strFile)) - 14)
Open strDataOutputFile For Output As 1
strDataErrorFile = "c:\acag\temp\Errors_Data.txt"
Open strDataErrorFile For Output As 2
Dim db As Database
Dim rstData As Recordset
Set db = CurrentDb
' delete previous table
db.TableDefs.Delete ("tblData")

Can anyone put me on the right track please.

-cicada-


What error do you get? Does tblData exist and if so, is it a linked table?
Or perhaps you are trying to delete the actual SQL Server table, rather than
the Access linked table.


Nov 13 '05 #3

P: n/a

"-cicada-" <jo********@a1.com.au> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Brian,

The error message is 'Path Not Found'

Yes, tblData does exist. In MS Access it shows in the Database window
under the table tab, but does not have the arrow next to it, to
indicate it is a linked table, as is usually the case. The table is
also listed in the SQL database, so having it listed in two databases,
without any indication of linking has confused me.
John Furphy

Brian Wilson wrote:
"-cicada-" <jo********@a1.com.au> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
> Excuse any errors in my description of the problem, as I'm only an
> amateur with Access.
>
> I've just created a simple VB application in A2000 that imports a text
> file into a table, and works fine. I then used the Microsoft Upsizing
> Wizard to create a new SQL database with an MS Access 2000 back end,
> and guess what, it not longer works, but stops at the line
>
> db.TableDefs.Delete ("tblData")
>
> The code to the point where it 'stops' is as follows:
>
> Dim objFile As TextFile
> ' Create new instance of TextFile class
> Set objFile = New TextFile
> ' Set the Path property
> objFile.Path = Trim(strDataInputFile.strFile)
> strDataOutputFile = "c:\acag\temp\" & Mid(strDataInputFile.strFile, 15,
> Len(Trim(strDataInputFile.strFile)) - 14)
> Open strDataOutputFile For Output As 1
> strDataErrorFile = "c:\acag\temp\Errors_Data.txt"
> Open strDataErrorFile For Output As 2
> Dim db As Database
> Dim rstData As Recordset
> Set db = CurrentDb
> ' delete previous table
> db.TableDefs.Delete ("tblData")
>
> Can anyone put me on the right track please.
>
> -cicada-


What error do you get? Does tblData exist and if so, is it a linked
table?
Or perhaps you are trying to delete the actual SQL Server table, rather
than
the Access linked table.


If all the tables should be in the SQL database, then the local table
shouldn't be there - so just manually delete it. Normally there should be
no need to delete the table, you can just delete all the records in it, but
if you really need to delete the table, you should make sure the table
exists with the function shown below.
If you need to delete a SQL Server table from an mdb file, then that is a
different matter. Let us know if you need code for that.
Function TableExists(strTableName As String) As Boolean

On Error GoTo Err_Handler

Dim dbs As DAO.Database
Dim tdf As DAO.TableDef

Set dbs = CurrentDb

For Each tdf In dbs.TableDefs
If tdf.Name = strTableName Then
TableExists = True
Exit For
End If
Next tdf

Exit_Handler:
On Error Resume Next
Set tdf = Nothing
Set dbs = Nothing

Exit Function

Err_Handler:
MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number
Resume Exit_Handler

End Function
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.