hi, i use the following code to connect to a Visual Foxpro db: #include <FileConstants.au3>
#include <MsgBoxConstants.au3>
$sqlCon = ObjCreate("ADODB.Connection")
$sqlCon.Mode = 16 ; sharedenynone
$sqlCon.CursorLocation = 3 ; client side cursor
$sqlCon.Open("Provider=vfpoledb.1;Data Source=x:\DATA\;Collating Sequence=general;")
if @error Then
MsgBox(0, "ERROR", "Failed to connect to the database")
Exit
EndIf
$sqlRs = ObjCreate ("ADODB.Recordset")
if not @error Then
$sqlRS.open("select IDENT, PICTURES from gbmas.dbf where STATUS = 'I'", $sqlCon)
if not @error Then
;Loop until the end of file
While Not $sqlRS.EOF
;Retrieve data from the following fields
$OptionName = $sqlRS.Fields('IDENT').Value
$OptionVal = $sqlRS.Fields('PICTURES').Value
Local $sFileRead = FileReadLine($OptionVal, 1)
MsgBox($MB_SYSTEMMODAL, "", "First line of the file:" & @CRLF & $sFileRead)
;MsgBox(0, "Record Found", "Nummer: " & $OptionName & @CRLF & "GTYP: " & $OptionVal)
$sqlRS.MoveNext
WEnd
$sqlRS.close
$sqlCMD = ObjCreate("ADODB.Command")
$sqlCMD.ActiveConnection = $sqlCON
$sqlCMD.CommandText = "update Opts.dbf set value = '.F.' where name = 'Option1'"
$sqlCMD.Execute
EndIf
EndIfthe column "Pictues" have multiple rows with unc paths. i want to read the content of the column "pictures" line by line to copy the unc files to another destionation with filecopy. i start to try with fileread line. but it does not work. Any ideas ? many thanks mike the content of column pictures looks like: U:\Bilder\Neumaschinen\P1080219.JPG U:\Bilder\P1080198.JPG U:\Bilder\P1080201.JPG U:\Bilder\30-TTR4400-II\P1080204.JPG