Jump to content
Sign in to follow this  
Chinasmoker

modify the value of a field

Recommended Posts

Chinasmoker

Maybe this topic 's no connection with au3,but if I cannt solve this trouble,that stand for my script 's no way to be continue,however,I must resolve it ,ok,talking my script,I use "addnew" to modify it ,but reture error

the initial value is null

below my script:

CODE
$dbname = (@DesktopDir & "\db1.mdb")

$tblname = "T1"

$fldname = "F1"

$T = "*"

_SelectData($dbname, $tblname, $fldname, $T)

Func _SelectData($dbname, $tblname, $fldname, $T)

$addfld = ObjCreate("ADODB.Connection")

$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $dbname)

$RS =ObjCreate("ADODB.Recordset")

$RS.ActiveConnection = $addfld

$RS.Open ("Select "&$T & " From " & $tblname )

$RS.AddNew

$RS.Fields(0).Value = "12345";

$rs.Post

msgbox(0,"",$RS.Fields(0).Name)

msgbox(0,"",$RS.Fields(0).Value)

$addfld.Close

EndFunc

Edited by Chinasmoker

One is never too old to learn

Share this post


Link to post
Share on other sites
martin

Maybe this topic 's no connection with au3,but if I cannt solve this trouble,that stand for my script 's no way to be continue,however,I must resolve it ,ok,talking my script,I use "addnew" to modify it ,but reture error

the initial value is null

below my script:

CODE
$dbname = (@DesktopDir & "\db1.mdb")

$tblname = "T1"

$fldname = "F1"

$T = "*"

_SelectData($dbname, $tblname, $fldname, $T)

Func _SelectData($dbname, $tblname, $fldname, $T)

$addfld = ObjCreate("ADODB.Connection")

$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $dbname)

$RS =ObjCreate("ADODB.Recordset")

$RS.ActiveConnection = $addfld

$RS.Open ("Select "&$T & " From " & $tblname )

$RS.AddNew

$RS.Fields(0).Value = "12345";

$rs.Post

msgbox(0,"",$RS.Fields(0).Name)

msgbox(0,"",$RS.Fields(0).Value)

$addfld.Close

EndFunc

Maybe this helps


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Chinasmoker

Thanks,just according that method,my script still error,and my script's running until go this line of "Addnew"


One is never too old to learn

Share this post


Link to post
Share on other sites
Chinasmoker

-_-Help me


One is never too old to learn

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×