Best way to load a test file into a flexgrid? 
Author Message
 Best way to load a test file into a flexgrid?

I have a file that I would like to load into a MS[H]Flexgrid. One row
= one line of the file.  No delimiters.
I konow that I can manually read the file and add row by row manually,
however this is a little slow and I need to do this often.
Is it possible to define a flat file as a recordset?
If so, how do you do that? Then I can test the speed versus a manual
load.

Thanks,
Gary...
-----------------------------------------------------------

VP Technology - Monitor Aerospace Corp.
-----------------------------------------------------------



Wed, 01 Sep 2004 20:38:32 GMT  
 Best way to load a test file into a flexgrid?
Hi,

you can open text file using ADO. What you need to do is
to open connection usign OLEDB Jet provider

loConnection.ConnectionString = "Data
Source=C:\VAL\XSLTest\;" & _
      "Extended Properties=""text;HDR=No;"""

Now you can read from text file

SELECT * FROM FileName.txt

Val

Quote:
>-----Original Message-----
>I have a file that I would like to load into a MS[H]
Flexgrid. One row
>= one line of the file.  No delimiters.
>I konow that I can manually read the file and add row by
row manually,
>however this is a little slow and I need to do this often.
>Is it possible to define a flat file as a recordset?
>If so, how do you do that? Then I can test the speed
versus a manual
>load.

>Thanks,
>Gary...
>----------------------------------------------------------
-

(H)
>VP Technology - Monitor Aerospace Corp.
>----------------------------------------------------------
-
>.



Fri, 03 Sep 2004 21:03:10 GMT  
 Best way to load a test file into a flexgrid?

I have a file that I would like to load into a MS[H]Flexgrid. One row
= one line of the file.  No delimiters.
I konow that I can manually read the file and add row by row manually,
however this is a little slow and I need to do this often.
Is it possible to define a flat file as a recordset?
If so, how do you do that? Then I can test the speed versus a manual
load.

When you say "no delimiters" that poses a problem. Does each field begin at the
same position in each row?


Microsoft MVP (Visual Basic)



Fri, 03 Sep 2004 21:47:10 GMT  
 Best way to load a test file into a flexgrid?
Paul,

When I say no delimeter, I mean it is not a comma delimitered file.
Each line is a normal text file ending with CR LF. Therefore one File
line = one flexgrid row.

I just can't figure out the provider and connect string.
Val on the prior message gave me the connect portion, now all I need
(hopefully) is the provider.

Thanks,
Gary...

Quote:


> I have a file that I would like to load into a MS[H]Flexgrid. One row
> = one line of the file.  No delimiters.
> I konow that I can manually read the file and add row by row manually,
> however this is a little slow and I need to do this often.
> Is it possible to define a flat file as a recordset?
> If so, how do you do that? Then I can test the speed versus a manual
> load.

>When you say "no delimiters" that poses a problem. Does each field begin at the
>same position in each row?


>Microsoft MVP (Visual Basic)

-----------------------------------------------------------

VP Technology - Monitor Aerospace Corp.
-----------------------------------------------------------


Sat, 04 Sep 2004 07:54:38 GMT  
 Best way to load a test file into a flexgrid?
Val,

I tried the following with no success.
vb says it db_file is not a valid path.
The path/file does exist.
Is the provider correct?

Private Sub Form_Load()
   Dim conn As ADODB.Connection
   Dim rs As ADODB.Recordset
   Dim db_file As String

   db_file = "C:\DNC\Job_1\6140a1a.pun"

    ' Open a connection.
    Set conn = New ADODB.Connection
    conn.ConnectionString = _
        "Provider=Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source=" & db_file & ";" & _
        "Extended Properties=""text;HDR=No;"""
    conn.Open

End Sub

Quote:

>Hi,

>you can open text file using ADO. What you need to do is
>to open connection usign OLEDB Jet provider

>loConnection.ConnectionString = "Data
>Source=C:\VAL\XSLTest\;" & _
>      "Extended Properties=""text;HDR=No;"""

>Now you can read from text file

>SELECT * FROM FileName.txt

>Val

>>-----Original Message-----
>>I have a file that I would like to load into a MS[H]
>Flexgrid. One row
>>= one line of the file.  No delimiters.
>>I konow that I can manually read the file and add row by
>row manually,
>>however this is a little slow and I need to do this often.
>>Is it possible to define a flat file as a recordset?
>>If so, how do you do that? Then I can test the speed
>versus a manual
>>load.

>>Thanks,
>>Gary...
>>----------------------------------------------------------
>-

>(H)
>>VP Technology - Monitor Aerospace Corp.
>>----------------------------------------------------------
>-
>>.

-----------------------------------------------------------

VP Technology - Monitor Aerospace Corp.
-----------------------------------------------------------


Sat, 04 Sep 2004 09:44:50 GMT  
 Best way to load a test file into a flexgrid?
Hi,

Provider is right. You can use OLEDB JET to do it. I see
that you specified file namr in full path, but it is not
correct. you need specify only path to file, and use file
name in SELECT statement

db_file = "C:\DNC\Job_1"

SELECT * FROM 6140a1a.pun

Here is my connection string, which is working 100 percent

loConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
          "Data Source=C:\TESTFOLDER\DD;" & _
          "Extended
Properties=""TEXT;DriverId=27;FIL=text;MaxBufferSize=2048;P
ageTimeout=5;"""

Val

Quote:
>-----Original Message-----
>Val,

>I tried the following with no success.
>vb says it db_file is not a valid path.
>The path/file does exist.
>Is the provider correct?

>Private Sub Form_Load()
>   Dim conn As ADODB.Connection
>   Dim rs As ADODB.Recordset
>   Dim db_file As String

>   db_file = "C:\DNC\Job_1\6140a1a.pun"

>    ' Open a connection.
>    Set conn = New ADODB.Connection
>    conn.ConnectionString = _
>        "Provider=Microsoft.Jet.OLEDB.4.0;" & _
>        "Data Source=" & db_file & ";" & _
>        "Extended Properties=""text;HDR=No;"""
>    conn.Open

>End Sub


>>Hi,

>>you can open text file using ADO. What you need to do is
>>to open connection usign OLEDB Jet provider

>>loConnection.ConnectionString = "Data
>>Source=C:\VAL\XSLTest\;" & _
>>      "Extended Properties=""text;HDR=No;"""

>>Now you can read from text file

>>SELECT * FROM FileName.txt

>>Val

>>>-----Original Message-----
>>>I have a file that I would like to load into a MS[H]
>>Flexgrid. One row
>>>= one line of the file.  No delimiters.
>>>I konow that I can manually read the file and add row
by
>>row manually,
>>>however this is a little slow and I need to do this
often.
>>>Is it possible to define a flat file as a recordset?
>>>If so, how do you do that? Then I can test the speed
>>versus a manual
>>>load.

>>>Thanks,
>>>Gary...
>>>--------------------------------------------------------
--
>>-

>>(H)
>>>VP Technology - Monitor Aerospace Corp.
>>>--------------------------------------------------------
--
>>-
>>>.

>----------------------------------------------------------
-

(H)
>VP Technology - Monitor Aerospace Corp.
>----------------------------------------------------------
-
>.



Sat, 04 Sep 2004 20:36:08 GMT  
 Best way to load a test file into a flexgrid?
Val,

I missed that part. It now loads the file!
One problem though. In some cases it is breaking the line into multi-fields.
I want 1 file line = 1 row and 1 field.
It appears that there is a default delimeter ",". How do I change the
delimiter and/or turn it off?

Thanks,
Gary...


Quote:
> Hi,

> Provider is right. You can use OLEDB JET to do it. I see
> that you specified file namr in full path, but it is not
> correct. you need specify only path to file, and use file
> name in SELECT statement

> db_file = "C:\DNC\Job_1"

> SELECT * FROM 6140a1a.pun

> Here is my connection string, which is working 100 percent

> loConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
>           "Data Source=C:\TESTFOLDER\DD;" & _
>           "Extended
> Properties=""TEXT;DriverId=27;FIL=text;MaxBufferSize=2048;P
> ageTimeout=5;"""

> Val

> >-----Original Message-----
> >Val,

> >I tried the following with no success.
> >vb says it db_file is not a valid path.
> >The path/file does exist.
> >Is the provider correct?

> >Private Sub Form_Load()
> >   Dim conn As ADODB.Connection
> >   Dim rs As ADODB.Recordset
> >   Dim db_file As String

> >   db_file = "C:\DNC\Job_1\6140a1a.pun"

> >    ' Open a connection.
> >    Set conn = New ADODB.Connection
> >    conn.ConnectionString = _
> >        "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> >        "Data Source=" & db_file & ";" & _
> >        "Extended Properties=""text;HDR=No;"""
> >    conn.Open

> >End Sub


> >>Hi,

> >>you can open text file using ADO. What you need to do is
> >>to open connection usign OLEDB Jet provider

> >>loConnection.ConnectionString = "Data
> >>Source=C:\VAL\XSLTest\;" & _
> >>      "Extended Properties=""text;HDR=No;"""

> >>Now you can read from text file

> >>SELECT * FROM FileName.txt

> >>Val

> >>>-----Original Message-----
> >>>I have a file that I would like to load into a MS[H]
> >>Flexgrid. One row
> >>>= one line of the file.  No delimiters.
> >>>I konow that I can manually read the file and add row
> by
> >>row manually,
> >>>however this is a little slow and I need to do this
> often.
> >>>Is it possible to define a flat file as a recordset?
> >>>If so, how do you do that? Then I can test the speed
> >>versus a manual
> >>>load.

> >>>Thanks,
> >>>Gary...
> >>>--------------------------------------------------------
> --
> >>-

> >>(H)
> >>>VP Technology - Monitor Aerospace Corp.
> >>>--------------------------------------------------------
> --
> >>-
> >>>.

> >----------------------------------------------------------
> -

> (H)
> >VP Technology - Monitor Aerospace Corp.
> >----------------------------------------------------------
> -
> >.



Sun, 05 Sep 2004 01:39:53 GMT  
 Best way to load a test file into a flexgrid?
You can refer to this KB article:

HOWTO: Open Delimited Text Files Using the Jet Provider's Text IIsam
(Q262537)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q262537

If your file doesn't contain delimiters, you can remove the parameters for
HDR and FMT.

Luke

(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Sun, 05 Sep 2004 15:27:50 GMT  
 Best way to load a test file into a flexgrid?
Hi,

I did not try, but you could do that. Try to
add "Format=FixedLength" to the extended properties of
connection string

Val

Quote:
>-----Original Message-----
>Val,

>I missed that part. It now loads the file!
>One problem though. In some cases it is breaking the line
into multi-fields.
>I want 1 file line = 1 row and 1 field.
>It appears that there is a default delimeter ",". How do
I change the
>delimiter and/or turn it off?

>Thanks,
>Gary...



>> Hi,

>> Provider is right. You can use OLEDB JET to do it. I see
>> that you specified file namr in full path, but it is not
>> correct. you need specify only path to file, and use
file
>> name in SELECT statement

>> db_file = "C:\DNC\Job_1"

>> SELECT * FROM 6140a1a.pun

>> Here is my connection string, which is working 100
percent

>> loConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" &
_
>>           "Data Source=C:\TESTFOLDER\DD;" & _
>>           "Extended

Properties=""TEXT;DriverId=27;FIL=text;MaxBufferSize=2048;P

- Show quoted text -

Quote:
>> ageTimeout=5;"""

>> Val

>> >-----Original Message-----
>> >Val,

>> >I tried the following with no success.
>> >vb says it db_file is not a valid path.
>> >The path/file does exist.
>> >Is the provider correct?

>> >Private Sub Form_Load()
>> >   Dim conn As ADODB.Connection
>> >   Dim rs As ADODB.Recordset
>> >   Dim db_file As String

>> >   db_file = "C:\DNC\Job_1\6140a1a.pun"

>> >    ' Open a connection.
>> >    Set conn = New ADODB.Connection
>> >    conn.ConnectionString = _
>> >        "Provider=Microsoft.Jet.OLEDB.4.0;" & _
>> >        "Data Source=" & db_file & ";" & _
>> >        "Extended Properties=""text;HDR=No;"""
>> >    conn.Open

>> >End Sub


>> >>Hi,

>> >>you can open text file using ADO. What you need to do
is
>> >>to open connection usign OLEDB Jet provider

>> >>loConnection.ConnectionString = "Data
>> >>Source=C:\VAL\XSLTest\;" & _
>> >>      "Extended Properties=""text;HDR=No;"""

>> >>Now you can read from text file

>> >>SELECT * FROM FileName.txt

>> >>Val

>> >>>-----Original Message-----
>> >>>I have a file that I would like to load into a MS[H]
>> >>Flexgrid. One row
>> >>>= one line of the file.  No delimiters.
>> >>>I konow that I can manually read the file and add row
>> by
>> >>row manually,
>> >>>however this is a little slow and I need to do this
>> often.
>> >>>Is it possible to define a flat file as a recordset?
>> >>>If so, how do you do that? Then I can test the speed
>> >>versus a manual
>> >>>load.

>> >>>Thanks,
>> >>>Gary...
>> >>>-----------------------------------------------------
---
>> --
>> >>-



- Show quoted text -

Quote:
>> >>(H)
>> >>>VP Technology - Monitor Aerospace Corp.
>> >>>-----------------------------------------------------
---
>> --
>> >>-
>> >>>.

>> >-------------------------------------------------------
---
>> -

>> (H)
>> >VP Technology - Monitor Aerospace Corp.
>> >-------------------------------------------------------
---
>> -
>> >.

>.



Sun, 05 Sep 2004 23:36:04 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST

2. Sort a test 2 ways: by student/answer

3. dropdownlists and grids, which ways is the best?

4. good ways to use recordsets without autocommit?

5. Better ways to schedule?

6. good ways to use recordsets without autocommit?

7. Better ways to put text into textbox??

8. Testing performance of VB 5.0 FlexGrid, Grid32 and VB 3.0 Grid

9. Speed Problem in Loading a Flexgrid

10. Other easier simpler ways to access a mdb file from VB

11. TEST TEST TEST TEST

12. highlighting a flexgrid row when form loads

 

 
Powered by phpBB® Forum Software