Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9246007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:23:36+00:00 2026-06-18T09:23:36+00:00

I am attempting to create a login mechanism by which you can access a

  • 0

I am attempting to create a login mechanism by which you can access a remote SQL Server 2008 R2 database, in a private network, if the credentials are correct. I intend to implement the database at my work server and this program at a client which is in the same subnet as the server. Here is my code so far:

Func Login()

   $loginGUI = GUICreate("Login", 250, 150, -1, -1) ; will create a dialog box that when displayed is centered
   GUISetState(@SW_SHOW)
   GUICtrlCreateLabel ( "Input valid credentials to login", 40, 10,-1,-1) 
   GUICtrlCreateLabel ( "Username", 40, 40,-1,-1)
   Local $userInput = GUICtrlCreateInput("", 100, 37, 100, 20)
   GUICtrlSetState($userInput, $GUI_FOCUS)
   GUICtrlCreateLabel ( "Password", 40, 70,-1,-1)
   Local $passwordInput = GUICtrlCreateInput("", 100, 67, 100, 20, $ES_PASSWORD)
   Local $loginButton = GUICtrlCreateButton("Login", 40, 105, 70)
   Local $exitButton = GUICtrlCreateButton("Exit", 130, 105, 70)

   GUISetState()
   ; Run the GUI until the dialog is closed
   While 1
      $msg = GUIGetMsg(1)
      Switch $msg[0]
         Case $loginButton
            $user = GUICtrlRead($userInput)
            $password = GUICtrlRead($passwordInput)
            Global $loginCon = ObjCreate( "ADODB.Connection" )
            With $loginCon
               .ConnectionString =("DRIVER={SQL Server};SERVER=192.168.1.30\SQLEXPRESS;DATABASE=Test;UID="&$user&";PWD="&$password&";")
               .Open
            EndWith
            If ($user ="" and $password="") or @error Then
               MsgBox(48, "Login error", "Connection failed! Wrong Username/Password.")
               GUICtrlSetData($userInput, "")
               GUICtrlSetData($passwordInput, "")
               GUICtrlSetState($userInput, $GUI_FOCUS)
            Else
               $loginCon.Close
               GUIDelete()
               Main()
               ExitLoop
            EndIf
         Case $exitButton
            GUIDelete()
            ExitLoop
         Case $GUI_EVENT_CLOSE
            GUIDelete()
            ExitLoop
      EndSwitch
   WEnd

EndFunc

I’ve also did the following actions:

  1. Used SQL Server Management Studio to allow remote connections as well as the proper permissions for the correct user to access the database.
  2. Used SQL Server Configuration Manager to enable SQL Server Browser and the TCP/IP protocol with the proper configurations to access the server.
  3. Created a firewall Inbound and Outbound rule which allows access to TCP port 1433 and UDP port 1434 for the server and client (just in case).
  4. Added sqlservr.exe and sqlbrowser.exe to the firewall allowed programs list.
  5. Installed SQL Server Native Client 2008 R2 on the client PC.

I could connect locally to my database using the server IP but I get the following error when attempting to connect from the remote client to the server:

err.description is: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

Strangely enough, I could connect from the remote client using sqlcmd. I also have to mention that I am currently using my laptop to hold my test database. It’s IP is assigned by the DCHP server from work and always remains the same.

Is my code incorrect or do I have to make additional server/client configurations?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:23:37+00:00Added an answer on June 18, 2026 at 9:23 am

    Instead of doing that way I suggest to have client and server written in autoit. Put server to remote computer and make it interact with database locally. Than return what you want to client. This approach is more secure also. Here is where you can start

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a login function with SQL server 2008 express and
I am attempting to connect to a database I created in SQL Server 2008
I am attempting to create a login system that has two access levels. If
Im attempting to create a new operator :? on lists, which operates the same
I'm attempting to create a CustomControl which will have various properties affected by an
I'm attempting to create an anti-bruteforcer for the login page on a website. Unfortunately,
I am attempting to create an application that will call a remote modem and
I'm attempting to create a user login for Facebook and Windows LiveId using DotNetOpenAuth
I am attempting to create a telnet client that I can use to transfer
I am attempting to create a login system. My UserController has this to control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.