Importing a Fixed Width *.txt file to a Access DB 
Author Message
 Importing a Fixed Width *.txt file to a Access DB

I am trying to import a Fixed Width file to an Access 97 DB.  I know how
to import a Comma delimited, but not a fixed width.  If someone could
please help me with this I would really appericate it.  Here is an example
of what I have as a comma delimited *.txt  

Do While Not EOF(1)
        Input #1, strBank_Num, strAppl_Code, strQue_ID, strNext_Contact,
strCurr_Bal, strAccnt_Num, strName1, strName2, strAddress1, strAddress2,
strCity_State, strZip, strHome_Phone, strWork_Phone, strOther_Phone,
strAct_Dlq_Dte, strLast_Pay_Dte, strNext_Pay_Dte, strAmt_Delq,
strCurr_Payoff, strOfficer_Code, strDealer_Num, strBranch_Num,
strDays_Delq, strAcct_Open, strLast_Ext, strPromise_One, strPromise_Two,
strDays_Delq_15, strDays_Delq_30, strDays_Delq_60, strDays_Delq_90,
strPromise_Broken, strPromise_Kept, strExt_Months, strCredit_Score,
strLoan_Type, strLoan_Class, strMat_Date

What would it be for the fixed width?  I already have the spacing figured
out, just need to know how to write it.

Thanks in advance.

Darrick

--
Posted via CNET Help.com
http://www.*-*-*.com/



Sat, 09 Nov 2002 03:00:00 GMT  
 Importing a Fixed Width *.txt file to a Access DB
You might try creating a Type Statement.
ex.
Private Type DarrickType
  strBack_Num = string * X1
  strAppl_Code = string * X2
  strQue_ID = string * X3
end type

dim xyz as darricktype

open filename as #1
while not eof(1)
  get 1, , xyz
  var1 = zyx.strback_Num
  var2 = zyx.strappl_code
wend

Quote:

> I am trying to import a Fixed Width file to an Access 97 DB.  I know how
> to import a Comma delimited, but not a fixed width.  If someone could
> please help me with this I would really appericate it.  Here is an example
> of what I have as a comma delimited *.txt

> Do While Not EOF(1)
>         Input #1, strBank_Num, strAppl_Code, strQue_ID, strNext_Contact,
> strCurr_Bal, strAccnt_Num, strName1, strName2, strAddress1, strAddress2,
> strCity_State, strZip, strHome_Phone, strWork_Phone, strOther_Phone,
> strAct_Dlq_Dte, strLast_Pay_Dte, strNext_Pay_Dte, strAmt_Delq,
> strCurr_Payoff, strOfficer_Code, strDealer_Num, strBranch_Num,
> strDays_Delq, strAcct_Open, strLast_Ext, strPromise_One, strPromise_Two,
> strDays_Delq_15, strDays_Delq_30, strDays_Delq_60, strDays_Delq_90,
> strPromise_Broken, strPromise_Kept, strExt_Months, strCredit_Score,
> strLoan_Type, strLoan_Class, strMat_Date

> What would it be for the fixed width?  I already have the spacing figured
> out, just need to know how to write it.

> Thanks in advance.

> Darrick

> --
> Posted via CNET Help.com
> http://www.help.com/



Sat, 09 Nov 2002 03:00:00 GMT  
 Importing a Fixed Width *.txt file to a Access DB
Thanks for the help.....

Darrick

Quote:

> You might try creating a Type Statement.
> ex.
> Private Type DarrickType
>   strBack_Num = string * X1
>   strAppl_Code = string * X2
>   strQue_ID = string * X3
> end type

> dim xyz as darricktype

> open filename as #1
> while not eof(1)
>   get 1, , xyz
>   var1 = zyx.strback_Num
>   var2 = zyx.strappl_code
> wend


> > I am trying to import a Fixed Width file to an Access 97 DB.  I know
how
> > to import a Comma delimited, but not a fixed width.  If someone could
> > please help me with this I would really appericate it.  Here is an
example
> > of what I have as a comma delimited *.txt

> > Do While Not EOF(1)
> >         Input #1, strBank_Num, strAppl_Code, strQue_ID,
strNext_Contact,
> > strCurr_Bal, strAccnt_Num, strName1, strName2, strAddress1,
strAddress2,
> > strCity_State, strZip, strHome_Phone, strWork_Phone, strOther_Phone,
> > strAct_Dlq_Dte, strLast_Pay_Dte, strNext_Pay_Dte, strAmt_Delq,
> > strCurr_Payoff, strOfficer_Code, strDealer_Num, strBranch_Num,
> > strDays_Delq, strAcct_Open, strLast_Ext, strPromise_One,
strPromise_Two,
> > strDays_Delq_15, strDays_Delq_30, strDays_Delq_60, strDays_Delq_90,
> > strPromise_Broken, strPromise_Kept, strExt_Months, strCredit_Score,
> > strLoan_Type, strLoan_Class, strMat_Date

> > What would it be for the fixed width?  I already have the spacing
figured
> > out, just need to know how to write it.

> > Thanks in advance.

> > Darrick

> > --
> > Posted via CNET Help.com
> > http://www.help.com/

--
Posted via CNET Help.com
http://www.help.com/


Mon, 11 Nov 2002 03:00:00 GMT  
 Importing a Fixed Width *.txt file to a Access DB
Still having trouble getting the information into the variables.  I have
already defined my TYPE, just need help getting the information into the
variables, so I can write it to a database.

please help.
Thanks....

Quote:

> I am trying to import a Fixed Width file to an Access 97 DB.  I know how
> to import a Comma delimited, but not a fixed width.  If someone could
> please help me with this I would really appericate it.  Here is an
example
> of what I have as a comma delimited *.txt  

> Do While Not EOF(1)
>         Input #1, strBank_Num, strAppl_Code, strQue_ID, strNext_Contact,
> strCurr_Bal, strAccnt_Num, strName1, strName2, strAddress1, strAddress2,
> strCity_State, strZip, strHome_Phone, strWork_Phone, strOther_Phone,
> strAct_Dlq_Dte, strLast_Pay_Dte, strNext_Pay_Dte, strAmt_Delq,
> strCurr_Payoff, strOfficer_Code, strDealer_Num, strBranch_Num,
> strDays_Delq, strAcct_Open, strLast_Ext, strPromise_One, strPromise_Two,
> strDays_Delq_15, strDays_Delq_30, strDays_Delq_60, strDays_Delq_90,
> strPromise_Broken, strPromise_Kept, strExt_Months, strCredit_Score,
> strLoan_Type, strLoan_Class, strMat_Date

> What would it be for the fixed width?  I already have the spacing
figured
> out, just need to know how to write it.

> Thanks in advance.

> Darrick

> --
> Posted via CNET Help.com
> http://www.help.com/

--
Posted via CNET Help.com
http://www.help.com/


Fri, 15 Nov 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ???Importing Fixed Width TXT File

2. HELP:Fixed-Width Text File to Access 97 DB

3. IMEXGRD32.OCX - Access Fixed Width Import Grid OCX

4. Fixed-Width Import/Export Specification File

5. Importing Fixed-Width text files

6. Importing Fixed Width Text Files

7. Importing Fixed Width Text Files

8. import comma delimited txt files into db

9. ACCESSING: Fixed Width Text Files

10. Export an Access table to a text (fixed width) file

11. Converting a Fixed Width text file to an access database table

12. Import fixed length file into Access using VB?

 

 
Powered by phpBB® Forum Software