Oracle Statements

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
valcrist
Posts: 5
Joined: 20 Sep 2015, 09:27

Oracle Statements

23 Oct 2017, 07:26

Hello everyone.

Anyone knows how to make oracle statements (select, update, insert, delete) from ahk?

I found an old code that I tryied to run once, but cound't make work.

Code: Select all

Query(Query)
{
  ConnectionString := "Provider=OraOLEDB.Oracle.1;Data Source=MYDB;User Id=id_user;Password=password;"
  
  oCon := ComObjCreate( "ADODB.Connection")
  oCon.ConnectionTimeout := 3 ; Allow 3 seconds to connect to the server.
  oCon.CursorLocation := 3 ; Use a client-side cursor server.
  oCon.CommandTimeout := 900 ; A generous 15 minute timeout on the actual SQL statement.
  oCon.Open( ConnectionString ) ; open the connection.

  oRec := oCon.execute( Query )
  
  try
    value := oRec.Fields(0).value
	
  oCon.Close()
  
  return value
}

res := Query("select NUMERODF from teste")
MsgBox % res
return
Everytime i try to run the code, i got a "Provider not found" messenge.

I have a tsn configured this way, on a oracle 11g:
MYDB=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MY_IP)(PORT=MY_PORT)))(CONNECT_DATA=(SERVICE_NAME=MY_SN)));

Anyone can help me how to configure this so i can run sql statements from my ahk?

Thanks in advance.
User avatar
tank
Posts: 3122
Joined: 28 Sep 2013, 22:15
Location: CarrolltonTX
Contact:

Re: Oracle Statements

23 Oct 2017, 09:07

I no longer have access to any such setups but it seems like you might be missing a driver
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, mikeyww and 307 guests