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 7738417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:15:32+00:00 2026-06-01T08:15:32+00:00

The client machines do not have access to the SQL Server port and opening

  • 0

The client machines do not have access to the SQL Server port and opening the port to the client machines is not possible.

Scenario: We have an old client application written entirely in javascript. The javascript contains a clear text connection string, including a sql server account username and password. We also use ASP.NET to host other applications.

We were hoping to move the connection to the server without having to rewrite the entire javascript application.

Is there a way to just replace the connection in the .js file with a server-side connection without having to write AJAX (or something similar) calls for every data function in the .js files?

Here is how the clients used to connect before the SQL Server port was changed:

var conn_str = "DRIVER=SQL SERVER;SERVER=MyServer;DATABASE=MyDb;UID=sqluser;PWD=mypassword;";

function openConn() {
    //alert("openConn() ");
    this.conn = getAdoDb("ADODB.Connection");
    conn.ConnectionTimeout = 240;
    conn.CommandTimeout = 240;
    conn.open(conn_str, "", "");
    //alert("Current Connection String: " + conn_str);}

The above code is in a javascript file with thousands of lines of code. We’d like to simply replace this connection part of the javascript with something on an ASPX page or AJAX or something that could be consumed by the .js file.

  • 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-01T08:15:34+00:00Added an answer on June 1, 2026 at 8:15 am

    Is there a way to just replace the connection in the .js file with a server-side connection without having to write AJAX (or something similar) calls for every data function in the .js files?

    If you are going to use server side technologies, AJAX is just one option. You can embed the retuned data in your pages to be consumed by javascript (ie. output JSON to the page) etc.

    You can create a generic server side data function that will accept the SQL and parameters, but will need to validate the passed in queries and parameters to avoid SQL Injection and tampering.

    In my opinion, there is no secure way around replacing all the data functions.

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

Sidebar

Related Questions

A new client of mine has a small VB/Access database application written in 2002
I have two machines I work on: Windows Client (Development Machine) Linux Web Server
I have a WCF client/service app that relies on secure communication between two machines
So we have a piece of software which has a poorly written SQL statement
I am developing a windows desktop client/server application in .NET where the client application
I have installed SQL Server 2008 R2 Express on a Windows Server 2008 R2
I have created a SQL DB-based winforms application, and I want to deploy it
I am trying to connect to SQL Server 2008 (not express) with PHP 5.2.9-2
I am developing a webbased business application (JS/node) that, on some client machines, needs
I'm working on a C# application that queries a SQL Server 2008 Express instance

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.