Per
|
| Posted: 11/08/2002, 4:16 AM |
|
I need suggestions of how to create a
grid with filenames collected from
the server. Using the filesystemobject
I can retrieve the filenames, but how
do I populate a recordset manually ?
|
|
|
 |
RonB
|
| Posted: 11/08/2002, 8:41 AM |
|
If I understand you correctly you want to get the filenames and then insert them into a table(just the name not the file)?
Or do you want to read the content of a directory and insert the filenames automaticaly into a tabel?
|
|
|
 |
Per
|
| Posted: 11/11/2002, 3:03 AM |
|
The later. I would like to modify the
recordset that builds a grid manually.
I can read from the recordset, but not
assign values to it.
I guess that i have to make it in two
steps : first fill a table and then
display the table in a grid. I just
thought it wasn't necessary since i
could retrieve the filenames directly.
|
|
|
 |
RonB
|
| Posted: 11/11/2002, 6:04 AM |
|
Hope I understand what you mean. I included the code I use for getting the entire content of an image directory(file names not the actual file itself)
and inserting it in a table in mysql:
function image_load_BeforeInsert() { //image_load_BeforeInsert @3-340109F7
//Custom Code @8-2A29BDB7
// -------------------------
//I use a dummy record with an insert button and created a BeforeInsert event
global $image_load;
$db=new clsDBConnection1;
//define the path as relative
$path = "/Program Files/Apache Group/Apache/htdocs/eden/images_jewelry/";
//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");
//running the while loop
while ($file = readdir($dir_handle))
{
$sql="insert into image_load(image_file) values(" .CCToSQL($file,'text') .")";
$db->query($sql);
}
//closing the directory
closedir($dir_handle);
// -------------------------
//End Custom Code
Hope this is what you want
|
|
|
 |
Per
|
| Posted: 11/11/2002, 7:14 AM |
|
Thanks,
I will use that solution, even though I
hoped to be able to build an "unbound" grid.
Like the ListOfValues in Listboxes.
|
|
|
 |