User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 392,373 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,775 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:

Access table data transfer to file

Join Date: Oct 2006
Posts: 2
Reputation: TheDugglerrr is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
TheDugglerrr TheDugglerrr is offline Offline
Newbie Poster

Troubleshooting Re: Access table data transfer to file

  #2  
Nov 30th, 2006
Hi Saurabh,

It sounds to me like you require the ability to specify the Data-Type when importing fields into MSAccess, because sometimes MSAccess guesses the field types incorrectly.


I dont have the complete solution, but a suggested starting point.

The idea is to create a recordset (based on your SQL), and then read through it one record at a time. each record is then written to the textfile.

Theres a bit of code missing lol, this isnt a copy n paste solution my friend

Anyways, I hope I helped
good luck!


Private Sub Command0_Click()

'Create a Connection Object
'Create a Recordset object based on your SQL

Open "J:\Power Equipment\Common\SK\db.TXT" For Output As #1

While Not rst.EOF

Print #1, rst("ImageID") & vbTab & rst("ImageWidth" & vbCrLf)

Wend

Close #1

End Sub


Private Sub Command1_Click()
strSQL = "delete * from AUTHENTICATION_TEST"
DoCmd.RunSQL strSQL
DoCmd.TransferText acImportDelim, "Db Import Authentication Specification", "AUTHENTICATION_TEST", "J:\Power Equipment\Common\SK\db.TXT"
End Sub
Reply With Quote  
All times are GMT -4. The time now is 1:11 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC