Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Class quirk?


I have a module which instantiates a class to set up an ado connection.

I have a variable:
Private p_strFileName As String

I have a property:
Friend Property Let ADOFileName(ByVal strFileName As String)
p_strFileName = strFileName
End Property
Friend Property Get ADOFileName() As String
ADOFileName = p_strFileName
End Property

in the method I have:
Set p_Connection = New ADODB.Connection
p_Connection.Open "Driver={Microsoft Text Driver (*.txt; *.csv)};"
& _
"Dbq=" & ADOFileName & ";" & _
"Extensions=asc,csv,tab,txt;"

which causes an error. However, If i hard-code the path in the
method:
strpath = "C:\WINDOWS\Documents and
Settings\username\Desktop\Folders\Quantitive\Test"
Set p_Connection = New ADODB.Connection
p_Connection.Open "Driver={Microsoft Text Driver (*.txt; *.csv)};"
& _
"Dbq=" & strpath & ";" & _
"Extensions=asc,csv,tab,txt;"

I'm missing something here and I cant see what.
tia,
matt.


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=566555

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Class quirk?


for the forum...

Set p_connection = New ADODB.Connection

with p_connection
provider = "Microsoft.Jet.OLEDB.4.0"
connectionstring = "Data Source=FilePath\;Extended
Properties='text;HDR=YES;FMT=Delimited'"
open
end with


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=566555

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional formatting quirk Alison KS[_2_] Excel Discussion (Misc queries) 8 December 8th 07 01:05 PM
An Interesting vba Excel quirk GeorgeJ Excel Discussion (Misc queries) 7 August 14th 07 02:11 AM
AutoFilter Quirk Humpton Excel Discussion (Misc queries) 0 June 21st 07 09:09 PM
data validation quirk bwb Excel Programming 6 February 4th 05 02:20 AM
a VLOOKUP quirk Clarence Crow Excel Worksheet Functions 6 December 3rd 04 01:06 PM


All times are GMT +1. The time now is 05:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"