Jump to content

Recommended Posts

Posted (edited)

I'm with MS SQL Express 2014.
Went to the wiki - Databases_and_web_connections but I can't find a way =/

the strings I've got are:

ODBC;DSN=eFilmWorkstation;Trusted_Connection=Yes
ODBC;DSN=eFilmWorkstation;UID=sa;PWD=eFilmWS30
"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE';"

A working example ? ( that would run if you had the db )
Or, advise in a UDF to use and how to use it ?

I don't care to write, just to read.

Thanks
 

Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

found the solution :) 

#include <_sql.au3>
#include <array.au3>

Opt ("trayIconDebug",1)

Msgbox(0,"","Start the Script and load the error handler")
 _SQL_RegisterErrorHandler();register the error handler to prevent hard crash on COM error

$oADODB = _SQL_Startup()
If $oADODB = $SQL_ERROR then Msgbox(0 + 16 +262144,"Error 1",_SQL_GetErrMsg())

If _sql_Connect($oADODB,"localhost\SQLEXPRESSEFILM","eFilmWorkstation","sa","eFilmWS30") = $SQL_ERROR then
    Msgbox(0 + 16 +262144,"Error 2",_SQL_GetErrMsg())
    _SQL_Close()
    Exit
EndIf

Local $aData,$iRows,$iColumns;Variables to store the array data in to and the row count and the column count
$iRval = _SQL_GetTable2D(-1,"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE';",$aData,$iRows,$iColumns)
If $iRval = $SQL_OK then _arrayDisplay($aData,"2D  (" & $iRows & " Rows) (" & $iColumns & " Columns)" )
_SQL_Close()

 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

Try my ADO.au3 udf. 

Look in my signature. 

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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
×
×
  • Create New...