Jump to content

Verify user before beginning script


Recommended Posts

Hi all,

I'm new to autoit, but thanks to many reading hours of the forum Q&A and the help files i'v managed to get a script up and running.

My script opens a Gui that asks the user for his username.

I want to make a veification function that will connect to my sql database that is hosted online (bluehost) and verifies that the username is registered.

I have the database up, and I don't need the script to insert new members, only to read from the Username table and match it to the input the user entered. If he is a registerd user, the script will go on, else, msgbox...

Can someone please give me a hint on how to start... I know very little about SQL.

Link to comment
Share on other sites

There is a using ODBC and another without ODBC available.

This should give you some functions to start with.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

When using the ODBC version you have to define a DSN (run ODBCAD32 for setup). The second UDF seems to use a DLL.

I haven't tried any of this UDFs. Just take a look at the functions and pick the UDF that offers what you need.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I'm stuck...

Did so much work and spent so many hours and I just can't figure out that last connection.

These UDF's are too complicated, I don't need to insert or write into the tables, only to read in one table if the user is there or not..

so I will need to connect to my DB, check if user is there and proceed.

maybe I don't really know ow to use a UDF...

Link to comment
Share on other sites

It's not too complicated nor complex.

Include th UDF into your script using the #include directive.

Use the function to connect to the MySQL database.

Create the SQL query statement using the username. Something like: "Select * from usertable where username = '" & $sUser &"'"

Execute the sql query using one of the UDFs functions.

Check the result.

Done.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

OK,

Now the last answer you gave me there really organized things for me and I'm pretty sure I'm on the track.

I started using a UDF called EZMySQL, it was a link from one of the UDFs you pointed out for me.

so I have the line in the UDF:

_EzMySql_Open($Host, $User, $Pass, $Database = "", $Port = 0, $unix_socket = "", $Client_Flag = 0)

I know these parameters: $User, $Pass, $Database

But the rest I don't know where to find them: $Host, $Port, $unix_socket, $Client_Flag

This is what he wrote in the UDF:

$Host - hostname or an IP address ;(my host is bluehost.com.. but thats not what I write, right?)

$Port - If port is not 0, the value is used as the port number for the TCP/IP connection

$unix_socket - specifies the socket or named pipe that should be used. (no pipe: "" (empty string))

$Client_Flag - flags to enable features

sorry if my questions are obvious and a bit stupid..

Thanks for your patience and support!!!1

Link to comment
Share on other sites

Parameters $Port, $unix_socket and $Client_Flag are optional. If you don't need to set them, ignore them.

$Host - hostname or an IP address ;(my host is bluehost.com.. but thats not what I write, right?)

When you've set up the MySQL at bluehost you will have been given information how to access it. That should include the hostname/IP address, port number ...

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Shlasi,

the Example Forum is for disussing the functionality of an example script or UDF.

I would discuss obvious coding problems here.

Can you post the code you use?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

My host support say that in order to access my DB from remote connection I need to whitelist the ip adress. (it seems that I'll be needing to whitelist every users IP??!!)

So, I'mm thinking of a different approach,

It's not a problem to have my user list on a table in a webpage (the table will come from the DB..)

But, is there a chance I can access that page with my script without actually openning the webbrowser?

I only need to read from it not to insert data..

Link to comment
Share on other sites

My host support say that in order to access my DB from remote connection I need to whitelist the ip adress. (it seems that I'll be needing to whitelist every users IP??!!)

No, You only need to whitelist on your firewall every outgoing connection (IP-address) of bluehost.com where you want to connect to.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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...