Donato
Sun Jan 22 11:01:19 CST 2006
thank your for your help ; but now i must modify the script so :
- i should add 1 to a numeric filed if a files are present on my hard disk;
il the file are present and i add 1 to the filed the scrit must be stop also
the script must run
"Dave Patrick" <DSPatrick@nospam.gmail.com> ha scritto nel messaggio
news:udm2xR2HGHA.3000@TK2MSFTNGP14.phx.gbl...
> Give this a go.
>
> Const adOpenDynamic = 2
> Const adLockOptimistic = 3
>
> Dim cnn, dbPath
> dbPath = "c:\data\access\test1.mdb"
> Set cnn = CreateObject("ADODB.Connection")
> Set Rs1 = CreateObject("ADODB.Recordset")
> cnn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath
> strSQL = "SELECT * FROM tblUsers"
> rs1.Open strSQL, cnn, adOpenDynamic, adLockOptimistic
> rs1.AddNew
> Rs1.Fields("username")= "Dave"
> Rs1.Fields("password")= "zzz"
> rs1.update
> cnn.close
>
>
> --
>
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
>
http://www.microsoft.com/protect
>
> "Donato P" wrote:
> | ok your script working if i wanto read some date from a access database;
> but
> | if i want to modify some date i don't work. i have modificate the scrit
bu
> i
> | donìt work can help me :
> |
> | the script that i have modificate is this :
> |
>
| -------------------------------------------------------------------------
> |
> | Dim Conn, dbPath
> | dim firstName(), lastName()
> | dbPath = "c:\download.mdb"
> | Set Conn = CreateObject("ADODB.Connection")
> | Set Rs1 = CreateObject("ADODB.Recordset")
> | Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath
> | Source = "SELECT * FROM tblUsers"
> | Rs1.cursorType = 1
> | Rs1.Open Source, Conn,,,adCmdTable
> | Rs1.MoveLast
> | msgBox (Rs1.RecordCount)
> | Rs1.MoveFirst
> | i=0
> | do while rs1.eof = false
> | redim preserve firstName(i)
> | redim preserve lastName(i)
> | firstName(i) = Rs1.Fields("username")
> | lastName(i) = Rs1.Fields("password")
> | fName = firstName(i)
> | lName = lastName(i)
> | i=i+1
> | msgBox (fName & " " & lName)
> | Rs1.moveNext
> | Loop
> | Rs1.MoveFirst
> |
> | Rs1.Fields("username")=fname + fname
> | Rs1.Fields("password")=lname +lname
> | rs1.update
> |
> | conn.close
> |
>
| --------------------------------------------------------------------------
--
> | --
> |
> |
> | help me to find why i don't work
>
>