473,756 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ODBC, Linux, Win2k - how to automate DSN setup?

I need to access databases on both win2k and Linux systems but I have to set
up the DSNs under program control ... no uses using GUIs ...

Has anyone done this? if so can we discuss it either in here or offline?

thanks

Tom

Jul 17 '05 #1
1 4979
"Tom Jones" <to******@lucen t.com> wrote:
I need to access databases on both win2k and Linux systems but I have to set
up the DSNs under program control ... no uses using GUIs ...

Has anyone done this? if so can we discuss it either in here or offline?

thanks

Tom


I have not been successful with the ODBC route on Linux. As far as
unixODBC is concerned -- it's a joke to me because I see no way to
configure or use it.

Try FreeTDS from freetds.org, which then integrates with PHP's mssql_*
API library. TDS is the native protocol of SQL Server 6.5, 7, and 2K.

side note {
BTW, have another database out there on the Windows platform that you
want to connect to? You can use the SQL Server 7 or 2K's Linked
Servers technique (see a howto by doing a search on Google) in SQL
Server to link it to MS Access, MS Excel, or almost any database you
want on the Windows side. Linked Servers is under the "Security"
folder in SQL 7 or 2K. Once linked, you use a special syntax that
looks like this:

select * from <server>.<datab ase>.dbo.<table > --> for a SQL server
connection
or
select * from <app name>...<table> --> for something like an MS Access
connection
}

Anyway, back on FreeTDS...

1. Prove to yourself that your Linux firewall config is setup right by
pinging the other MS SQL Servers and see if you get a response, then
trying to telnet to port 1433 on that remote SQL Server. If you can
even get in, but cannot type anything without a decent response, then
your firewall is setup to give you access.

2. Now use FreeTDS's tsql test tool to test it by doing:

tsql -S ip.ip.ip.ip -H windows01 -p 1433 -U sa -P ''

Of course, replace ip.ip.ip.ip, windows01, sa, and '' with what is
appropriate for your environment.

Once in, you'll see:

1>

Type:

use pubs
go
select * from authors
go
\q

This proves that FreeTDS works.

3. You'll need to find out how to recompile PHP and Apache with mssql
support via FreeTDS. This is no cakewalk and I've had some failed
attempts. One of the big problems is that the process for compilation
to get FreeTDS support is a changing thing -- sites on the web, and
even on the PHP.net website, give conflicting or erroneous
information. Still, however, I persist, because I think eventually I
will get it right. Jochen Daum out of New Zealand has been giving me
advice in this newsgroup for the past couple of days, but I have yet
to get it right on my system. On Monday and Tuesday (11/24-25/2003)
I'm going to be trying feverishly hard to give it a good stabbing
again.

4. Although it is not recommended, if I cannot get freeTDS support in
PHP, I just might use PHP shell commands to execute tsql, get a
result, parse it, and use it. The tsql app recommends you don't do it,
but if it works, and I need a quick interim measure, I might have no
choice.

5. Another route I've considered, which would be a big project, is to
bring up a socket server on Windows using Visual Basic 6 and the
Winsock control. Many books and websites describe how to properly
build a socket server by using a "control array" in VB6. Anyway, the
socket server will sit on a TCP port. I would have to use my own
protocol so that the Linux system could login, make a SQL request,
receive a response, and parse it. PHP has a socket API that I could
use for calling the Windows system. On the Windows system, I could use
the ADO library in COM to access the SQL Server, Access, or other
database, get a response, and send it back. A big problem, however,
might be lockups, so I expect that I'll need to build something that
runs from Windows Scheduled Tasks to kill the VB app if the last
request it made was longer than 15 minutes ago. As for the protocol,
one could use a very simple XML, or could come up with something
simpler and with less parsing (and processor time) required. I've
thought the protocol could be unencrypted, but that I would require a
password on each SQL request, and a proprietary CRC set of bytes would
need to be included with every TCP stream in order to ensure that
hackers couldn't get in very easily. I might also restrict which host
IP could get into that socket server as a means to block hackers too.

Anyway, here's the calamity I'm in, and why I'm desperate to connect
PHP/Linux to MS SQL Server. I was working a lot in Linux/JSP, which
has more than one MS SQL Server JDBC driver. I sold my boss on going
with Linux/JSP rather than MS/ASP or MS/.NET. Then, I discovered PHP,
and had a lot of success with it and could knock out more work than
JSP, so I convinced the boss that this was the way to go. When I did
that, however, I never realized that MS SQL Server access would be so
dang aggravatingly difficult from PHP, requiring PHP and Apache
recompilation on RH9. So now I have very little time to prove to my
boss that PHP is great, and can suit our needs in the office, before
he pulls the plug on me and says we're going to go Linux/JSP, which I
find more time-consuming.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5208
by: Sean Anderson | last post by:
ODBC under System DSN Setup Access Driver give it the DSN (Data Source Name) MSA Click on Select and point to the myfile.mdb (your database file)
10
10761
by: David ROBERT | last post by:
Hello, I need to read data from a MS Access database. The program (reader) is installed on a linux box and is written in python langage. The database is MS Access 2002 installed on a Win XP box networked with the linux box. Is it possible for python/linux to read data from MS Access Database ?
13
4588
by: Peter Maas | last post by:
Recently I replaced Win2k with Linux on my desktop computer. Using mostly multi-platform software I thought this would be easy. It was not as easy as expected getting wxPython to work. There seemed to be no SuSE RPM so I installed from source. Here are my steps (gtk 2.4 was already installed): - Built wxWidgets (.configure --enable-unicode) - Built wxPython (python setup.py install) error: "you should use wx-config program for...
0
2236
by: Chetan | last post by:
I have setup an ODBC driver for my MySQL database and use a 3rd party program to connect to it. Everytime the software connects, the ODBC driver setup screen pops up. I have to click OK on it to continue. I set the parameter "Dont prompt on connect" in the options but this has not solved the issue. The system setup is Win2K SP2, MySQL 4.0.15, MySQL ODBC driver 3.51. Any help will be appreciated.
2
3075
by: bbxrider | last post by:
win2k adv server/ iis5.0/vb6.0/ado and/or odbc connections on client machine i have an mdb on win2k adv server machine and want internet read/write to it from both a non-windows, red hat, webserver using asp/vbscript and a win xp/2000 machine with vb6.0/ado with or without odbc set up how do you set up the win2k server machine and/or mdb??? i know enough that some application/service needs to be listening on some port so far i have the...
2
5524
by: Marco Martin | last post by:
Hi, I posted earlier about beeing able to find an SQL server database through code and someone was kind enough to help me out(thank you Scott). I now have another question; My app was written using odbc because of the need to install the program and use different databases depending on what the client has/owns. I now need to create an ODBC connection string during installation.
0
861
by: 이재국 | last post by:
Please help point me in the right direction. I am trying to SQLDriverConnect to our Oracle Server, which resides on another machine in the network. I believe I have the ODBC connection set up correctly, as clicking "Test Connection" and then entering a valid username/password connects successfully. Here is the tnsnames.ora file from my client machine:
3
1613
by: Richard Morton | last post by:
Hi, This is my first posting to this list, I guess a small intro should be first, been developing in PHP for sometime, mainly with Mysql and nearly always on Windows (oops, sorry). I have done some bizarre things with PHP, but now I am involved in re-writing an application (from ASP.NET). The database however I can't change so easily as there are other
2
1571
by: Philippe Martin | last post by:
Hi, I understand that access can be accessed through an ODBC driver under windows (instead of Jet). I am wondering if the same can be done under Linux. Regards, Philippe
0
9455
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9869
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9838
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9708
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5140
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3354
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.