slaughter Posted January 11, 2008 Share Posted January 11, 2008 Sub Main() Dim cn as New ADODB.Connection Dim rs as New ADODB.Recordset 'Open the connection cn.Open "DSN=<MyDataSourceName>;" & _ "UID=<MyUsername>;" & _ "PWD=<MyPassword>;" & _ "Database=<MyDatabaseName>" 'Clear the table cn.Execute "DELETE FROM vbtest;" 'For updateable recordsets we would typically open a Dynamic recordset. 'Forward Only recordsets are much faster but can only scroll forward and 'are read only. Snapshot recordsets are read only, but scroll in both 'directions. rs.Open "SELECT id, data, accessed FROM vbtest", cn, adOpenDynamic, adLockOptimistic 'Loop though the recordset and print the results 'We will also update the accessed column, but this time access it through 'the Fields collection. ISO-8601 formatted dates/times are the safest IMHO. While Not rs.EOF Debug.Print rs!id & ": " & rs!data rs.Fields("accessed") = Format(Now, "yyyy-MM-dd hh:mm:ss") rs.Update rs.MoveNext Wend 'Add a new record to the recordset rs.AddNew rs!id = 76 rs!data = 'More random data' rs!accessed = Format(Now, "yyyy-MM-dd hh:mm:ss") rs.Update 'Insert a new record into the table cn.Execute "INSERT INTO vbtest (id, data) VALUES (23, 'Some random data');" 'Refresh the recordset to get that last record... rs.Requery 'Get the record count rs.MoveLast rs.MoveFirst MsgBox rs.RecordCount & " Records are in the recordset!" 'Cleanup If rs.State <> adStateClosed Then rs.Close Set rs = Nothing If cn.State <> adStateClosed Then cn.Close Set cn = Nothing End Sub In progress: Windows Server bruteforce GUARD Admin Tools (Remote client control) Bypasing firewall Old stuff: [font="Verdana;"]MD5 Auto Update Calendar XP SS multi usser server & client Autoit Remote Control (ARC)[/font] Link to comment Share on other sites More sharing options...
Developers Jos Posted January 11, 2008 Developers Share Posted January 11, 2008 You forgot to specify the question/issue you have or is your expectation that somebody will do the whole conversion for you ? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Zedna Posted January 11, 2008 Share Posted January 11, 2008 Search forum for examples using ADODB and make this simple conversion according to them. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
slaughter Posted January 11, 2008 Author Share Posted January 11, 2008 Search forum for examples using ADODB and make this simple conversion according to them.Tryed... But all the time geting same errorhttp://www.autoitscript.com/forum/index.ph...470&hl=odbcmaybe soone can convert to working script.. :/ im getting despred.. Have a grat project but cant acomplishe it because of stupid PostGres ODBCPleas help me... :/ In progress: Windows Server bruteforce GUARD Admin Tools (Remote client control) Bypasing firewall Old stuff: [font="Verdana;"]MD5 Auto Update Calendar XP SS multi usser server & client Autoit Remote Control (ARC)[/font] Link to comment Share on other sites More sharing options...
weaponx Posted January 11, 2008 Share Posted January 11, 2008 So you made a duplicate topic? Link to comment Share on other sites More sharing options...
slaughter Posted January 11, 2008 Author Share Posted January 11, 2008 If you wuld look you wuld se post are difrent one is abuot ODBC other one to convert In progress: Windows Server bruteforce GUARD Admin Tools (Remote client control) Bypasing firewall Old stuff: [font="Verdana;"]MD5 Auto Update Calendar XP SS multi usser server & client Autoit Remote Control (ARC)[/font] Link to comment Share on other sites More sharing options...
slaughter Posted January 11, 2008 Author Share Posted January 11, 2008 Thanks all for help or ideas or just saying "make it by your self" Done PostGres Func postgres_query($query) $oConn = ObjCreate("ADODB.Connection") $oRS = ObjCreate("ADODB.Recordset") $cmd = ObjCreate("ADODB.Command") $line2 = "DRIVER={PostgreSQL ANSI};DATABASE=Incoming_rates;" & _ "SERVER=localhost;PORT=5432;Uid=odbc_usr;" & _ "Pwd=odbc_usr;" & _ "A0=0;A1=6.4;A2=0;A3=0;A4=0;A5=0;A6=;A7=100;A8=4096;A9=0;" & _ "B0=254;B1=8190;B2=0;B3=0;B4=1;B5=1;B6=0;B7=1;B8=0;B9=1;C0=0;C1=0;C2=dd_" $oConn.Open ($line2) $oConn.execute ($query) $oConn.Close EndFunc In progress: Windows Server bruteforce GUARD Admin Tools (Remote client control) Bypasing firewall Old stuff: [font="Verdana;"]MD5 Auto Update Calendar XP SS multi usser server & client Autoit Remote Control (ARC)[/font] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now