Jump to content

modify the value of a field


Recommended Posts

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

Link to comment
Share on other sites

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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...