Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with . that becomes #

Status
Not open for further replies.

goldwhispers

Programmer
Jun 21, 2000
123
ZA
dunno if this is the right place?

when i put this value into a string varaible

set cc = "fin.aba"

this is to be appended to the file name, the file name comes out with a # instead of a .

anybody know why? ta
 



Hi,

Set is used for an OBJECT, not a variable. Its just
Code:
cc = "fin.aba"

Skip,

[glasses] [red][/red]
[tongue]
 


I meant to say, Set is used for an object variable not a string variable.

Skip,

[glasses] [red][/red]
[tongue]
 
Hi goldwhispers,

thanks so the correct way would be?? lol
... what Skip said. What's the problem with that?

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
ah i missed that! ta
well i do have it like that and its still doing it..


Sub IMNew()
Dim rs As DAO.Recordset
Dim bb As String
Dim cc As String

Set rs = CurrentDb.OpenRecordset("SELECT TableName from ABA ")
', dbOpenSnapshot, dbSeeChanges)
cc = "FIN.ABA"
Do Until rs.EOF
aa = rs!TableName
 
actually this is not the problem at all.... (the cc being set to an object)

the system is converting it to a #, ive changed the code like this



Sub IMNew()
Dim cc As String
Dim rs As DAO.Recordset
Dim bb As String

cc = "ABA"
Set rs = CurrentDb.OpenRecordset("SELECT TableName from ABA ")
', dbOpenSnapshot, dbSeeChanges)
Do Until rs.EOF
aa = rs!TableName


DoCmd.TransferDatabase acImport, "ODBC Database", _
"ODBC;DSN=FM_AVAF;UID=author;PWD=analyst;LANGUAGE=us_english;" _
& "DATABASE=FM_ABA", acTable, aa, aa

DoCmd.TransferText acExportDelim, , aa, "J:\external\FIM\IM\ABA\FIN" & Chr(46) & cc & aa & ".csv", True
Dim dbs As Database
Set dbs = CurrentDb()
dbs.Execute "drop table " & aa

rs.MoveNext
Loop

dbs.Close
rs.Close


the problem is with Chr(46), if i put a char for another character that comes out fine, its only the period that doesn't any advice?
 
Why are you using Chr(46) at all? Why don't you put the period inside with the \FIN ?

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Then the problem is obviously not the Chr(46). The # symbol is likely in your aa or cc variable. Have you checked those?
 
no i dont think so, this is my code

Sub IMNew()
Dim cc As String
Dim rs As DAO.Recordset
Dim bb As String

cc = "ABA"
Set rs = CurrentDb.OpenRecordset("SELECT TableName from ABA ")
', dbOpenSnapshot, dbSeeChanges)
Do Until rs.EOF
aa = rs!TableName


DoCmd.TransferDatabase acImport, "ODBC Database", _
"ODBC;DSN=FM_AVAF;UID=author;PWD=analyst;LANGUAGE=us_english;" _
& "DATABASE=FM_ABA", acTable, aa, aa

DoCmd.TransferText acExportDelim, , aa, "J:\external\FIM\IM\ABA\" & "FIN" & Chr(46) & cc & aa & ".csv", True
Dim dbs As Database
Set dbs = CurrentDb()
dbs.Execute "drop table " & aa

rs.MoveNext
Loop

dbs.Close
rs.Close
 
In response to GlennUK's post, you said you took out the Chr(46) and it still displayed the # symbol...so again I say, it's obviously not the Chr(46) that's causing your problem. Or did you not really take it out? Try this...

"J:\external\FIM\IM\ABA\" & "FIN." & cc & aa & ".csv"

If that doesn't work, try checking the values of your cc and aa variables to see if the # symbol is in one of those.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top