MSSQL Connection
Feb 8, 2006
Hi all,
Why doesn't my connection to ms sql server 2005 work?
Get this error...
Error connecting to server. Server says: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I set up a DSN which is working.(tested ok anyway)
What do I need to do?
Thanks.
PHP Code:
// Configure connection parameters
$dsn = "localhost";
$username = "training";
$password = "training2";
// Connect to DB
$db_link = odbc_connect($dsn, $username, $password)
or die('Error connecting to server. Server says: '.htmlspecialchars(odbc_errormsg()));
// Select Database
mssql_select_db('training_dub') or die('Error connecting to Database. Server says: '.htmlspecialchars(odbc_errormsg()));
View 2 Replies
ADVERTISEMENT
Sep 8, 2005
I've come from the asp world into .NET and I have looked all over the web for the proper way to make a database connection to a MSSQL server and all I have found is samples of connections to Access databases. Can anyone point me in the direction of how to create a db connection for microsoft sql server.thanks
View 1 Replies
View Related
Jul 9, 2007
I am connecting to the mssql database using ADOdb. It states that the connection was successful however, none of the query functions are working....
I get the following error:
[unixODBC][Driver Manager]Data source name not found, and no default driver specified
Any helped would be greatly appreciated.
Thanks
Code:
<?php
require_once('config.inc.php');
include('/usr/local/adodb/adodb.inc.php');
ADOLoadCode("ado_mssql");
$spevent = $_POST['spevent'];
echo $spevent."<br>";
$db = ADONewConnection('odbc_mssql');
$dsn = "Driver={SQL Server};Server=SPSERVER;Database=SPDATABASE";
$db->Connect($dsn,SPUSER,SPPWD);
if($db) {
echo "Connection Successful<br>";
$sql = "Select ID from tblEvent where ID = '26622'";
$rs = $db->Execute($sql);
if(!$rs){
echo "Bad<br>";
echo $db->ErrorMsg();
}
else{
echo "Good<br>";
}
}
else{
echo "Error in connection";
exit;
}
?>
View 2 Replies
View Related
Feb 17, 2007
I am new to MSSQL but have some experience with MySQL. Now, I am trying to connect to a recently installed MSDE 2000 SP3 on my box, using dbManager Professional, (a 3rd party manager) but all attempts to connect have failed.
The first error message when I start dbM is:
Connection failed:
SQLState: '42000'
SQL Server Error: '18456'
Login failed for user 'Administrator'
(There are no passwords assigned.)
There are successive error messages if I keep forcing the issue, with additional error indicators.
MSSQL is running and the .ini file contains these 2 lines:
BLANKSAPWD=1
SECURITYMODE=SQL
I have searched the web for solutions for all of the above messages, and implemented some logically sound advice, but these solutions, which worked for others, don't solve this problem for me.
The OS is XP Professional SP2
AMD 64 Sempron 1800+
1GB of RAM.
Any suggestion is greatly appreciated.
ineuw
View 2 Replies
View Related
Jul 20, 2005
HelloI've prepared a small aplication in VS.NET and I use SqlConnection class.Everything is ok, but when I'm trying to disconnect from server usingif (cnSQL->State != ConnectionState::Closed) cnSQL->Close()there is still connection do server present. I have to close connectionbecause I'm trying to drop this database.Have you ever heard about this kind of problem??Trociu--Plain-text over all!!!/**********/write me : trociu@autonom ict pwr wroc plsearch me : gg: 1382729
View 1 Replies
View Related
Oct 8, 2006
Hi,
at first a few things about my system:
I use Visual Studio 2005 Pro on WinXP SP2 and I have recently installed MSSQL Server 2005 Express on my system.
I want to establish a connection to the MSSQL Server from C++ (not .NET) using ADO.
For this I use the following connection String:
Open(L"Provider=SQLNCLI;Server=FREECASTLE;Integrated
Security=SSPI;DataTypeCompatibility=80;MARS
Connection=True;",L"",L"",ADODB::adConnectUnspecified);
This works. But this is not exactly that what I wanted, because here
just my Windows Authentication is used. I want to be able to pass
username and password for users that are allowed to access the SQL
Server. Here my first confusion begins: I have the option to pass the username and password into the connection string (User Id and Password) or I guess that I can pass them also as parameter 2 and parameter 3. But with trying both of these options I get always a connection error that my specified Username is not be trusted ( I don't know how the message looks in the English version, because I have the german version), but I suppose you know what I mean.
Of course I have to create such accounts in the SQL Server before trying to login with them. I guess that I made something wrong when doing this. I started the Server Manager Studio and there I navigated into the Object Explorer. In the folder Security I created a new account for testing (using SQL Server Authentication). But I cannot use that account for logging in.
I have to admit that I am very new to the SQL Server thing, so I hope someone can help me or can give me hints on what to do better. I am very thankful for every reply...
View 3 Replies
View Related
Aug 29, 2007
I've searched the forums and found posts stating that there is no connection governer in the 2005 edition, but I am getting connection limitation errors. I have Standard Edition with 25 CALs.
------
A problem occurred when attempting to contact the server (Server returned: Connection reset). Please ensure that the server parameters passed to the driver are correct and that the server is running. Also ensure that the maximum number of connections have not been exceeded for this server.
-----
How can this be?
Thanks!
View 3 Replies
View Related
Jan 12, 2007
I make a site in my computer it's work localhost I make mssql connection in localhost but ı don't know how i make mssql connection on website
View 5 Replies
View Related
Mar 22, 2007
Hi,I'm using sql server 2005 express edition. I have created a database using sql server management studio express edition. Now I'm trying to connect it in visual studio 2005. It show following error. An error has occurred while establishing a connection to the server. When connections to SQL 5erver 2005, this failure may be caused by the fact under the server's default settings SQL Server does not allow remote connections, (provider: Named Pipes Provider, error: 40- Could not open a connection to SQL Server) I have enables named pipes from Sql services configuration manager.
View 1 Replies
View Related
Jun 14, 2004
Im getting an error when i try to connect to my MS SQL database
0x80040e21 .... multiple-step ole db operation generated errors ....check each ole db status value
this code works connecting to database via web hosting, only things i changed was to replace the server with "(local)" [also tried ip no joy there either] and add integrated security to the connection string
ms sql server and IIS, personal web server all on same laptop, i can access the same database with same details no problem to login it gives up on the subsequent login
code (generally)
Set objconn=Server.CreateObject("ADODB.Connection")
objconn.ConnectionString="SERVER=(local);Database=blah;uid=blah1;pwd=blah2;Integrated Security=true;"
objconn.open
can anybody help
ta, b
View 5 Replies
View Related
Jan 26, 2007
Hallo
i'm experiencing an extremely slow connection from a WXPP Sp2 client to a MSSQL2000 running on a W2k server. The client is running a VB6 application that connect with Windows authentication: every form requesting data opens with a long delay at the first launch; next attempts run normally fast.
In the same LAN there are some others identical clients, all running fine.
Every other network activity from that client is ok.
Where should i start to investigate from?
View 3 Replies
View Related
May 27, 2006
I am trying to make an ODBC connection to a MSSQL 2K server on a remote machine. I am using the SQL Server driver and can see the server in the drop down list when asked which server I would like to connect to. I am using SQL authentication over TCP/IP.
The error occurs when ODBC tries to connet to SQL server to obtain the default settings. The error I receive is as follows:
Connection Failed;
sqlstate '28000';
sql server error: 18456;
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'XXXX'
I have tried setting up alternate SQL Server users with varying security rights on the server but am not able to setup the ODBC connection.
I am setting the ODBC connection up on a windows XP SP2 machine.
The remote server is running Windows server 2003 (patched upto date) and MS SQL server 2K (SP3). The connection is over a LAN and does not pass through any firewalls (hardware or software). I can create the ODBC connection without issue locally on the server.
This is my first time creating an ODBC connection to a Windows 2003 Server and I am wondering if there is some additional config I may have missed out.
Many thanks.
View 3 Replies
View Related
Apr 22, 2004
i need a sql statment or procedure to kill all user connection to one database.
And Deny new connection for a little time.
So i can a restore this database from a dump.
I can this do only in exclusiv modus. without any other connection.
Can anybody help me??
thanks and best regards from Berlin, Germany
View 4 Replies
View Related
Nov 8, 2007
I am using MSSQL Server 2005 Express Studio and tryig to connetch to the remore server but does not work.
I get this error.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
Though I have read like child and made changes according to it.
http://support.microsoft.com/kb/914277
Still says same error.
I am clueless how to do it.
Do any one know web based mssql editor where i can connect mssql?
Thanks in advance.
View 2 Replies
View Related
Dec 28, 2006
Creating a web application. Running a simple query "SELECT username FROM vwCustomer"
vwCustomer is a view built on top of an Access DB which is set up as a linked server. Within SQL Server that view responds immediately. But when I try to access it from an ASP page it takes over 20 seconds to respond.
Used the following to create the linked server:
EXEC sp_addlinkedserver 'DBName', 'Jet 4.0', 'Microsoft.Jet.OLEDB.4.0', 'c:databasesdatabase.mdb'
GO
EXEC sp_addlinkedsrvlogin 'DBName', FALSE, NULL, 'Admin', ''
GO
The view is simply(this works fine in SQL Server):
SELECT * FROM DBName.db.dbo.customer
The ASP page:
SELECT * FROM vwCustomer
Can anyone give me a hint as to where the bottleneck is? Or how I can figure that out using SQL Profiler or something?
Please help!
View 3 Replies
View Related
Feb 20, 2008
Hi all.
I've had a web service developed in PHP5 running on an Apache webserver for the last 9 months. It handles a lot of XML requests and stores/reads from an MSSQL Server 2005 DB (Express, if that matters).
Occasionally, I will come across the error 'Could not connect to database'. Refreshing the page works 99% of the time removes the error and the system continues as normal. I'd say this is happening about 1/100 requests at the moment, and my client is steadily becoming more irritated by it.
As far as I know, the system settings are mainly stock. It was set up by another developer.
I'm out of ideas with regards to debugging this problem.
Can anybody shed some light, or some possible solutions?
Kind Regards,
Jomn
View 9 Replies
View Related
Sep 8, 2007
Hi
I have VC++ express and MSSQL SMS express and have an application working nicely locally. The Data explorer and data connections part works really easily.
Now, I want to make the application available to my home network.
I mapped the drive where the database is and called it Z: so I could put my "release" on my other network PC and assumed it would find Z: if I mapped the shared network drive on that machine and called it Z:
But: I can't even add the mapped connection on the local machine, I get:
The file "Z:databasescalorie.mdf" is on a network path not supported for database files. An attempt to attach.....etc"
It works fine on the original F drive.......
Am I approaching this the wrong way. How should I distribute to network PCs?
thanks hopefully
David
View 5 Replies
View Related
Aug 11, 2004
How many result-rows does mssql return should be used asynchronous method to use mssql cursor, can get the best performance in any time in any result offset?
i want to make the cursor fast in any time whatever how many results returned
View 2 Replies
View Related
Feb 10, 2008
Hi,
i was planning to create a database migration tool ..
its a certain database of a DMS (document management system) to
another DMS (two different DMS)... from DMS using msde 2000 server .. and tranfer to a DMS using a postgre sql or mssql .. depends ..
they have different table structures and names . . :D
i was thing of what language shall i use.. or what language is the best to work on this kind of project :)
hoping for your kind help guys. thanks :)
br
Frozenice
View 1 Replies
View Related
Sep 6, 2006
Does enabling/disabling Data Execution Prevention have a performanceimpact on SQL 2000 or SQL 2005?For SQL best performance - how should I configure for:Processor Scheduling:Programs or Background servicesMemory Usage:Programs or System Cache
View 9 Replies
View Related
Mar 24, 2008
Hi,
I am a bit new to the MSSQL server. In our application, we use so many SQL queries. To imporve the performance, we used the Database enigine Tuning tool to create the indexes. The older version of the application supports MSSQL 2000 also. To re-create these new indexes, I have an issue in running these "CREATE INDEX" commands as the statements generated for index creation are done in MSSQL 2005. The statements include "INCLUDES" keyword which is supported in MSSQL 2005 but not in MSSQL 2000.
Ex:-
CREATE INDEX IND_001_PPM_PA ON PPM_PROCESS_ACTIVITY
(ACTIVITY_NAME ASC, PROCESS_NAME ASC, START_TIME ASC, ISMONITORED ASC)
INCLUDE
(INSTANCE_ID, ACTIVITY_TYPE, STATUS, END_TIME, ORGANIZATION);
Any help in creating such indexes in 2000 version is welcome.
Thanks,
Suresh.
View 2 Replies
View Related
May 3, 2008
Hello
We are using SQL 2005 and now we are planning to use SQL 2000. what are the ways to do the process.
We taken the script spcificall for 2000 and run it in SQL 200. But we are getting the error in SCRIPT?
Could you please give me the step to do?
Thanks,
Sankar R
View 6 Replies
View Related
Oct 26, 1999
Hello:
I am currently work on mssql 6.5. On my workstation, I have mssql 6.5
cient software.
However, I would like to install mssql 7.0 server on my nt workstation
and work with it to become familiar with 7.0. Can I install mssql 7.0
server on my nt workstation? Can mssql 6.5 client coexist with mssql 7.0
on the same machine if they are in different directories?
Thanks.
David Spaisman
View 1 Replies
View Related
Jun 15, 2006
Ben writes "I have a sql script that doesn't function very well when it's executed on a SQL 2000 server.
The scrpt looks like this:
---------------------------------------------------------------------------------------------------
USE [master]
GO
IF NOT EXISTS (SELECT * FROM master.dbo.syslogins WHERE loginname = N'SSDBUSERNAME')
EXEC sp_addlogin N'SSDBUSERNAME', N'SSDBPASSWORD'
GO
GRANT ADMINISTER BULK OPERATIONS TO [SSDBUSERNAME]
GO
GRANT AUTHENTICATE SERVER TO [SSDBUSERNAME]
GO
GRANT CONNECT SQL TO [SSDBUSERNAME]
GO
GRANT CONTROL SERVER TO [SSDBUSERNAME]
GO
GRANT CREATE ANY DATABASE TO [SSDBUSERNAME]
GO
USE [master]
GO
If EXISTS (Select * FROM master.dbo.syslogins WHERE loginname = N'SSDBUSERNAME')
ALTER LOGIN [SSDBUSERNAME] WITH PASSWORD=N'SSDBPASSWORD'
GO
GRANT ADMINISTER BULK OPERATIONS TO [SSDBUSERNAME]
GO
GRANT AUTHENTICATE SERVER TO [SSDBUSERNAME]
GO
GRANT CONNECT SQL TO [SSDBUSERNAME]
GO
GRANT CONTROL SERVER TO [SSDBUSERNAME]
GO
GRANT CREATE ANY DATABASE TO [SSDBUSERNAME]
GO
USE [master]
GO
IF EXISTS (select * from dbo.sysdatabases where name = 'ISIZ')
DROP DATABASE [ISIZ]
GO
USE [SurveyData]
GO
exec sp_adduser 'SSDBUSERNAME'
GRANT INSERT, UPDATE, SELECT, DELETE
TO SSDBUSERNAME
GO
USE [SurveyManagement]
GO
exec sp_adduser 'SSDBUSERNAME'
GRANT INSERT, UPDATE, SELECT, DELETE
TO SSDBUSERNAME
---------------------------------------------------------------
I need to be converted to a script that can be executed on both MSSQL 2000 and MSSQL 2005.
I was wondering if somebody there could help me with this problem?!
Thanks,
Ben"
View 1 Replies
View Related
Nov 17, 2007
I've been tasked to move our production databases on MSSQL 2000 to 2005. I've supported MSSQL since version 6.5 and performed migrations to successor versions.
Current Environment is MSSQL 2000 32-bit with current Service Packs.
I've performed mock migrations on Test servers upgrading all Production instances simultaneously from MSSQL 2000 to 2005 32-bit. The Test environment is identical to Production minus server name, IP etc. Also I have a separate server with MSSQL 2005 installed where I use the DETACH / ATTACH and BACKUP / RESTORE method for migration / acceptance testing. There are approximately 30 databases totaling 70 GB. This has gone as expected and fairly successful. Vendors have been coordinated with to update code and staff for acceptance testing.
I'd prefer going directly to MSSQL 2005 64-bit instead if possible due to memory benefits etc. This is where I'd like some feedback prior to borrowing a 64-bit server for testing.
Upgrade options:
1. Is it better to migrate from MSSQL 2000 32-bit to 2005 64-bit via:
a. DETACH / ATTACH
b. BACKUP / RESTORE
c. Is one method more advantageous relating to the end result?
2. Regarding XP clients, have issues been experienced with the default SQL Server driver or is an alternate recommended for XP clients to connect to a MSSQL 64-bit server databases?
3. If you have performed this migration and have relevant experience please pass them along.
View 3 Replies
View Related
Sep 29, 2006
DB is developed on local computer with MSSQL 2005 Express. My host is on MSSQL 2005 workgroup. Are they compatible, because I am getting errors? Is my approach wrong?
I have tried several approaches.
A) I created a backup of database on my local, then placed a copy on the server. Then I tried to restore through Server Management Studio. I get this error.
TITLE: Microsoft SQL Server Management Studio
------------------------------
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
ADDITIONAL INFORMATION:
The backed-up database has on-disk structure version 611. The server supports version 539 and cannot restore or upgrade this database.
RESTORE FILELIST is terminating abnormally. (Microsoft SQL Server, Error: 3169)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=08.00.2039&EvtSrc=MSSQLServer&EvtID=3169&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
B: I also have tried copying the database. I put it in the same path as the other databases that can be read with server management studio on the server. Then, tried to get to it through server managements studio and it did not appear. So I tried to attach it. Then I received this error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Attach database failed for Server 'MROACH1'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Could not find row in sysindexes for database ID 10, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'LodgingDB'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 602)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=602&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
C: I have also tried opening the Database, and back up file through Server Management Studio. without success.
D: I also tried Windows and Software update at microsoft update, but no updates were recommended for Version on Server.
I'm surprised this is so hard. My original data base was created in same family of software. 2005 MS SQL Express. I could use some direct help from someone experienced with this. Am I doing it wrong or are the DB versions incompatible.
Mark Roach
View 5 Replies
View Related
Jan 18, 2008
How to convert a database in MSSQL 2000 to MSSQL 2005 database.Is there any tool or documentation available for this?
View 3 Replies
View Related
Aug 23, 2006
I added a connection (ADO.NET) object by name testCon in the connection manager - I wanted to programmatically supply the connection string. So I used the "Expressions" property of the connection object and set the connectionstring to one DTS variable. The idea is to supply the connection string value to the variable - so that the connection object uses my connection string.
Then I added a "Backup Database Task" to my package with the name BkpTask. Now whenever I try to set the connection property of BkpTask to the testCon connection object, by typing testCon, it automatically gets cleared. I am not able to set the connection value.
Then after spending several hours I found that this is because I have customized the connection string in testCon. If I don't customize the connection string, I am able to enter the "testCon" value in the connection property of the BkpTask.
Is this an intrinsic issue?
View 2 Replies
View Related
Sep 25, 2007
I have my MSSQL hosted, any interface i can use so i can't connect to the data source?
for Mysql, i know i can use phpmyadmin, or mysql interface.
i have no idea for MSSQL, any advices?
i know there is one, which is Toad, but it has a lots of limitations, any good idea?
thanks.
View 2 Replies
View Related
Feb 17, 2008
Hi,
till now i have used mysql with php.now i want to use mssql with php.my php and apache versions are
php 5.2.3
apache 2.2.4
from where i can get mssql and what i need to run my php scripts with mssql database.iam newbie in mssql.any of your help will be surely appreciated
thanks
mrjameer
View 2 Replies
View Related
Apr 25, 2006
Hi!
What is the best way to migrate MSSQL 2005 Express -> MSSQL 2005 Srv?
View 4 Replies
View Related
Feb 6, 2008
I have a package that uses a for loop to iterate through an unknown amount of excel files and pull their data into a table. However, there will be cases when the file is corrupted or has some sort of problem so that either the transformation will fail or the excel data source will fail with an oledb connection error.
Could anyone suggest a clean way to trap these errors? Specifically, the "Cannot Aquire Connection from Connection Manager", which is the excel connection.
Thanks,
John T
View 3 Replies
View Related
Mar 9, 2007
All --
Please help.
I have some questions about connection strings.
BACKGROUND...
Note that I am using the "SQL Native Client OLE DB Provider", SQL Sever 2005 Express, ASP.NET, C#.NET, and VS.NET 2005.
Note that I do not want to use the "Attach a database file" type of connection string.
Note that I am using the site http://www.ConnectionStrings.com as a reference.
Note that this "Standard security" connection string...<add name="LocalSqlServer" connectionString="Server=MYTESTOFFICESERVERS;Database=MyDatabase;Uid=MyDatabaseUser;Pwd=MyDatabasePassword;" />...does not work and causes the following run-time error...A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
Note that this "Trusted connection" connection string...<add name="LocalSqlServer" connectionString="Server=MYTESTOFFICESERVERS;Database=MyDatabase;Trusted_Connection=yes;" />...works but is less-than ideal because it uses a Trusted Connection rather than a Username/Password combination.
QUESTIONS...
(A) What exactly does the error in Item 4 mean?
(B) Do 4 and 5 imply that one must use a Trusted_Connection for all SQL Server 2005 Express connection strings when the database does not reside in the web application's App_Data folder or use a "Attach a database file" type of connection string?
(C) Are there any alternatives?
(D) What do you suggest?
Please advise.
Thank you.
-- Mark Kamoski
View 1 Replies
View Related