473,686 Members | 3,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TransferText method msaccess - Imported table corrupted

Hi,
I'm trying to import some text files in a simple access table, but
sometimes it miss some rows after import.
here is the code:
Public Function OpenMyApplicati onData() As Boolean
Dim Upid As Boolean
Dim LastBD As Integer
Dim dbs As Database
Dim fileN As String
Dim tableN As String
Set dbs = CurrentDb
On Error GoTo Err_OpenMyAppli cationData
Dim strMyApplicatio nDataFile As String
Dim strExitMessage As String
'windows common dialog- open file mode
strMyApplicatio nDataFile = OpenSaveCommonD ialog("Open",
GetAppDir() & "MyDataSubdirec tory", _
"Open MyApplication Data Files", "",
"MyApplicat ion Data Files(*.txt)", "*.txt")
LastBD = find_last(strMy ApplicationData File, "\")
fileN = "#" + Mid(strMyApplic ationDataFile, LastBD + 1)
tableN = Mid(strMyApplic ationDataFile, LastBD + 1,
Len(Mid(strMyAp plicationDataFi le, LastBD + 1)) - 4)
'test response
If (strMyApplicati onDataFile = "") Then
OpenMyApplicati onData = False
strExitMessage = "Attempt to open MyApplication Data Files
cancelled."
Else
'import the text file
OpenMyApplicati onData = True
strExitMessage = ""
dbs.Execute ("DELETE * FROM pivoti;")
DoCmd.TransferT ext acImportFixed, "ImpSpec", "pivoti",
strMyApplicatio nDataFile, False
dbs.Execute ("DELETE * FROM pivoti WHERE field1 = '' or
field1 is NULL;")
' dbs.Execute ("UPDATE pivoti set ID=count(*);")
dbs.Execute ("INSERT INTO pivoti (ID,field1) values (1,'" +
fileN + "');")
Upid = Update_ID
dbs.Execute ("loadprop")
MsgBox "Table loaded correctly!"

End If
Exit_OpenMyAppl icationData:
If Not (OpenMyApplicat ionData) Then
MsgBox strExitMessage, vbInformation, "MyApplicat ion Software"
End If
Exit Function

Err_OpenMyAppli cationData:
'on error fail the function
OpenMyApplicati onData = False
strExitMessage = "Error during attempt to open MyApplication
Data Files (error# " & Err.Number & " " & Err.Description & ")"
Resume Exit_OpenMyAppl icationData
End Function

the missing part (example)
SYMPATHIE=Simpa tia <--- imported
#AccountInteres tFeesCharges.js p

#ACCOUNT_CHARGE S
LIBCHARGES=SPES E
AVIS=Avviso
RELEVES=Estratt i conto
MOUVEMENTS=Movi menti
EXTRAITS=Estrat ti
ANNUEL=Annuali
BOUCLEMENT=Chiu sura processo
CDG=CDG
COM_BOUCLEMENT= Commissioni su chiusura processo
COM_MOUVEMENT=C ommissioni su movimenti
APPL_TARIF=Prez zo applicato
Y/N=Y/N* (*:Par defaut)
YN = Y/N* (*:Par defaut)

#ACCOUNT_FEES
LIBFEES=Commiss ioni su chiusura processo
SANS=Senza
DEBITMAX=Addebi to massimo
DEBITMOY=Addebi to medio
TOTALDEB=Totale addebiti
MARGEPLFD=Margi ne massimo
PLAFOND=Su massimo
DEPASPLFD=Massi mo superato
METHODE=Metodo 5+6
CREDITMOY=Accre dito medio

#ACCOUNT_INTERE STS <---- imported

thank you for helping
regards

Nov 13 '05 #1
0 1179

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3024
by: Vladislav Moltchanov | last post by:
I have discovered a couple of years ago, that import with DoCMD.TransferText for CSV text file doesn’t work in Acc2000, while it works perfectly in ACC97. which has been discussed on this newsgroup forum, so this fact was fixed. Since I have to transfer files from VMS( SAS ) to WIN (Access), I still keep using ACC97 as a simplest and reliable tool. However, final products, such as distributable data entry system for multi central...
3
9406
by: Oliver Gabriel | last post by:
Hi, i want to export a table for later import, using vba. That´s my code: export: filename = "C:\HVOtabelle.txt"
0
1588
by: Richard Beacroft | last post by:
Trying to write a C# Windows App to export all objects and content from 2 MSAccess 97 databases for comparison analysis. very little documentation found. Have managed to instantiate MSAccess, load database and iterate through relevant objects. Call to TransferText raises error: "Bad Variable Type" error. Call to SaveAsText raises error: "Object Reference Not Set To An Instance Of An Object" error.
12
2193
by: ckirby | last post by:
I've got a csv that I am trying to import into a SQL Server (2000) table through an adp (Access 2000). The form used gives the user the ability to browse for a file, then will import the file into a temp table for processing using this vba code: DoCmd.TransferText acImportDelim, , "tmpPaTimeClock2", Me!TimeFileName, False When I run the import through the code, the import is dropping any values less than one (apparently). I've got a...
0
1407
by: matchine | last post by:
This is a recommendation based on my research on an issue with the transfer text functionality. The comments below were from a tech I approched for help. "The transfer text process blocked after importing 6139 records each time on my side. After further research, there maybe a memory leak in TransferText. When the number of records exceeds its limitation, the transfer process blocked. Therefore, please abandon TransferText and write...
3
2630
by: Jim M | last post by:
I am trying to 'grab' a backend data path and filename from a text file (to be used when updated front ends are installed by users). I store this information by running: DoCmd.TransferText acExportDelim, , "qExportBackEndPath", Local_TxtFileName, True qExportBackEndPath simply pulls the text field 'BackEndPath' from my tblLocal, which has only one record containing a fields related to
1
1703
by: peridian | last post by:
Hello, Used these boards a few times before to find answers, wondered if somebody could help me out. (Using Access 2000, and DAO Reference Library). I have some code which used TransferText to link a series of Text files into the database. I then called a function which ran some validation through the entries imported by calling OpenRecordset with an SQL query to access the linked files (nothing complex, just a SELECT * FROM TableName...
5
3496
by: bwlee | last post by:
Hi All, I'm attempting to automate the import of .txt files into Access. When I use the File > Get External Data > Import function and select my import specification, the data is imported correctly and in order. When I use the TransferText macro, and specify all the same paramenters i.e. fixed width, import specification, file path, table name etc, the data is imported; however, it is 'jumbled.' It is not in the same order as the text...
4
1831
by: WillMiller | last post by:
Hi, I'm currently attempting to write a small Access Database which carries out the following tasks : 1. Imports Submission files (of a text variety) to a table using TransferText on a daily basis (many files into 1 table) 2. Imports Reject Files files (again of a text variety) to another table using Transfer Text. (again, daily, many files into 1 table) 3. Run a query which reports all submissions that haven't had a matching...
0
8581
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8514
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8766
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7598
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6439
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4307
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2205
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.