hey everyone need some help again, i have two computers both running in vista ultimate. one is a server and the other is like a terminal. my problem is, how do i connect the terminal to a database which is in the server? please provide me a step by step procedure.. i badly need it, this means life and death to me.LOL but yeah i really need it. please help me again. tnx

btw, we are using visual studio 2008 and sql server 2005.

Dani AI

Generated

Quick, practical checklist and troubleshooting notes that expand on the thread so far (references: , ).

Start with a short checklist (most common causes):

  • Confirm basic network reachability (ping server name and IP).
  • Make sure the SQL instance accepts TCP connections and is bound to a known port. Use SQL Server Configuration Manager to enable the TCP protocol and restart the service.
  • Verify the server is actually listening on the port (check with netstat).
  • From the client, test a raw TCP connection (telnet) or use a command-line SQL client to validate credentials and reachability.
  • Ensure the SQL login used by the app has proper database permissions; avoid using the built-in sysadmin account for routine app access.

Quick test commands and forms:

# on the server: confirm listener
netstat -ano | findstr 1433

# from a client: raw TCP test (replace IP/port)
telnet 192.168.1.50 1433

# quick SQL test (if sqlcmd is available)
sqlcmd -S 192.168.1.50,1433 -U appUser -P appPassword -Q "SELECT @@VERSION"

Connection-string pattern (use explicit IP+port when possible):

Server=tcp:192.168.1.50,1433;Database=MyDatabase;User Id=appUser;Password=appPassword;

If a named instance is used and dynamic ports are enabled, either specify the instance name (and run the browser service) or assign a fixed port and use the IP+port form above.

Troubleshooting tips:

  • Use a .udl file (create a text file, rename to test.udl, double-click and use the Data Link dialog) to quickly test provider/credentials from the client machine.
  • Check the SQL Server error log for "listening on" lines to confirm bound IPs/ports.
  • If connection times out, the most likely culprits are protocol disabled on the server, server not listening on expected port, or blocked traffic by a network device or OS firewall. If authentication fails, verify the login exists and the database is online.

Notes on remote PDF files (follow-up topic): store and reference PDFs via a network share (UNC path like \\ServerName\Share\file.pdf) with appropriate share and NTFS rights for the account the app uses, or consider storing file contents in the database when distribution and backup need to be atomic.

Recommended Answers

All 9 Replies

What problems are you having are right now? Post your code and issue symptoms. There are a lot of things that could go wrong with an sql connection.

hi sknake, my problem is how will i connect PC-2 to a database in PC-1. my program is actually composed of of 2 sub-programs, one is like a server and the other being the terminal. the server is the one that can make changes on the data base while the terminal is more of displaying what is in the database. PC-1 is the server and PC-2 being the terminal. again, my problem is how can i connect PC-2 to the database in PC-1. i tried searching the net and i found that i need to enable the sql browser and i did it, but to this date, i still cant connect to the database in PC-1. btw, i'm connecting through this code:

constr = "Data Source=CARLSATELITE\SQLEXPRESS;Initial Catalog=server;User ID=sa;Password=sa"
        con = New SqlConnection(constr)

        Try
            con.Open()
            da = New SqlDataAdapter("select * from ann_t", con)
            da.Fill(ds, "ann_t")
            con.Close()
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

please help me coz this means life and death to me. seriously.

What happens when you try to connect to the other server? Do you get an exception, and if so can you paste the error? How did you install SQL Server? Is it the full blown edition of SQL Server or the express edition? Did you set up a firewall rule in the server to allow remote connections? There is also an option at install-time for SQL server to enable/disable remote connections. By default SQL Server doesn't allow remote connections (for the express edition anyway) so you may need to configure SQL server to allow remote connections. Also what are the names of the two machines and which has SQL server installed?

i am not sure if its the full version, but most likely, it'll be the express but i will still check on it coz i dont have the installer with me. i also made an exemption in firewall so the sql browser and the other thing that i can't remember. i already configured it to enable remote connection. i installed it with sql server authentication and not with windows authentication. the names of the two PC are Calsatelite (server) and Menchi (terminal) they are both installed with sql server but the database to be accessed is within the C arlsatelite

hi again, i'm pretty much sure now that i'm using the express edition because i configured it to allow remote access. enabled sql browser and the other thing that i cant seem to remember. i also made an exemption in the firewall to make sure that these apps are allowed. i installed it with the sql server authentication and not with the usual windows authentication. btw, the names of the PC are Carlsatelite (server) and Menchie (terminal) both installed with sql server but then, the database to be accessed by Menchie is in Carlsatelite.

tnx in advence and i hope u can help me. T_T

>> i installed it with sql server authentication and not with windows authentication.

That is for password authentication but doesn't have anything to do with remote connections. What happens when you try to connect? I'm assuming you get an exception? Can you post the error on this thread? And have you read the article i posted earlier about configuring sql server to allow remote connection?
http://support.microsoft.com/kb/914277

commented: tnx my problem is no solved. thank you thank you +1

hey i have another question mate, btw, tnx its now working hehe thank you very much. but then i have another question. in my database, i have there a PDF Path, that specifies the Source of a PDF reader in my Project. i was wondering how can i specify that the file path is on the other computer and not on its local hard drive?

Create a new thread for your question since the topic has changed and post a link back here.

Please mark this thread as solved if you have found an answer to your original question and good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.