Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





ODBC Connection Fails


I am attempting to connect to Altiris Deployment Server through ODBC and this is the error I get:

Microsoft SQL Server ODBC Driver Version 03.70.1146

Running connectivity tests...

Attempting connection
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General network error. Check your network documentation.

TESTS FAILED!

I am connecting through a workstation shortcut. Funny thing is when I log onto the server that is actually running DS the ODBC connection connects immediately. Soemthing tells me it is a rights issue but I can not seem to isolate the problem.

Any help with this problem is greatly appreciated!

Thanks again! griedel :(




View Complete Forum Thread with Replies

Related Forum Messages:
Package Fails When I Use ODBC Connection (Fails On SQL Server Agent, OK In Visual Studio)
I did a small package with only one ODBC connection (Merant 3.70 32-Bit Progess).  This package runs well in Visual Studio and fails when runs by SQL Server Agent.

Configuration:

SQL Server Agent on a 32Bit server. 

The ODBC connection configuration in available on System DSN on this server.

The user of Server Agent have full access (Admin).

Connect Manager Provider: ".Net ProvidersOdbc Data Provider"

SQL Server version: 9.0.3042

 

Error Message:

Executed as user: TEKCON cadmin. ...ion 9.00.3042.00 for 32-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  16:50:33  Error: 2007-06-11 16:50:33.62     Code: 0xC0047062     Source: Data Flow Task DataReader Source [1]     Description: System.Data.Odbc.OdbcException: ERROR [HYC00] [MERANT][ODBC PROGRESS driver]Optional feature not implemented.  ERROR [HY000] [MERANT][ODBC PROGRESS driver]msgOpen: unable to open message file: PROMSGS  ERROR [IM006] [MERANT][ODBC PROGRESS driver]Driver's SQLSetConnectAttr failed.  ERROR [HYC00] [MERANT][ODBC PROGRESS driver]Optional feature not implemented.  ERROR [HY000] [MERANT][ODBC PROGRESS driver]msgOpen: unable to open message file: PROMSGS  ERROR [IM006] [MERANT][ODBC PROGRESS driver]Driver's SQLSetConnectAttr failed.     at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)     at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcCon...  The package execution fa...  The step failed.


I created a .bat file with this instruction and It's run well:

dtexec /f "C:Program FilesMicrosoft SQL Server90DTSPackagesIntegration Services Project estcom.dtsx"
pause

Why it's not running with SQL Server Agent???

View Replies !
BDE Connection Via ODBC To MS SQL Server Fails
Hi,

I have a strange problem accessing a MS SQL Database from my network.
I'm using an application that is based on BDE which uses ODBC to connect to a MS SQL DB.
When I tried to connect from the network with BDE,I got this error message:

BDE Error : 13059
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SQL Server does not exist or access denied.
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen (Connect()).


On the server side I'm using W2003 EE ,MS SQL 2000 Standard with SP4, BDE5.11.
On the client side it's an XP SP2 with MS SQL Client installed, same BDE 5.11
When I create an alias using ODBC and mapping to my server, it connects and the communication with the Database Server succeds:
TESTS COMPLETED SUCCESSFULLY!
When I'm trying to connect using BDE Admin and double clicking on the + sign of the alias I created usind ODBC admin I get the message I listed above.
Any help would be appreciated,

Thanks.

View Replies !
ODBC Connection Fails From Cluster Node
I had a stand alone sql server that I upgraded to a cluster. I have an odbc connection called my_connection. The odbc test works fine. When I call the dsn from a php script it fails with this message:

 

Warning: odbc_connect(): SQL error: [Microsoft][ODBC SQL Server Driver][DBNETLIB
]SQL Server does not exist or access denied., SQL state 08001 in SQLConnect in D
:storage est.php on line 3
Could not connect to my_connection!

 

This same script works fine from any other computer. Is there an issue with connecting to a virtual server from the node via ODBC? Is there something I need to change in the client protocols?

 

Thanks in advance.

View Replies !
Can't Find SQL Native Client In ODBC Connection Manager In SQL Server Open Database Connectivity (ODBC)
I apologize if this is not the correct forum for this posting. Looking at the descriptions, it appeared to be the best choice.

I am running Windows XP Pro SP2. I have installed the SQL Native Client for 
XP. However, when I try to add a new data source through ODBC Connection 
Manager, SQL Native Client is not listed as an option. I have followed this procedure on three other systems with no problems. What would be causing the
SQL Native Client to not show up in the list of available ODBC data sources?

View Replies !
SQL Connection In Vista With Trusted Connection Fails Under Local System Account Until Reboot
Hi All,

We are using the Windows Task Scheduler as a substitute for the SQL Server Agent, which isn't available in the Express edition. The scheduled task just calls a batch file, which in turn, runs a stored procedure using osql with the -E option for a Trusted Connection.

SQL Server Express has been installed using the defaults, which means the service is running in the "NT AUTHORITYNETWORK SERVICE" account. The scheduled task we create is set to run using the "NT AUTHORITYSYSTEM" account.

Now we find that on Windows Vista (tested using Ultimate Edition) that the scheduled task fails to run the stored procedure until the machine is rebooted the first time after installing SQL Server Express. When I say "fail", I mean that the stored procedure isn't executed. The scheduled task however completes and reports no errors. On Windows XP, we do not run into this problem so I suspect it has something to do with the UAC in Vista?

We further found that after installing SQL Server Express and creating the scheduled task in the "NT AUTHORITYNETWORK SERVICE" account, the scheduled task (and stored procedure) runs fine WITHOUT requiring a reboot.

Can anyone explain why a reboot is needed to get SQL Server Express to run the scheduled task correctly under Windows Vista and the SYSTEM account?

Any help or thoughts greatly appreciated.

View Replies !
Remote Connection Refused When Creating ODBC Connection To SQL Server 2005
When I create a new odbc connection to a SQL server 2005 Db I get a failure telling me dat de SQL server does not allow remote connections.

How can I allow the server to allow this.

 

Any help appreciated

 

regards

View Replies !
File ODBC Fails To SQL7
Have three xp machines running Office XP Pro with an AccessXP front-end connecting to an sql7 on nt4 back-end. The odbc file dsn is located in the same folder as the mdb on a server (for regular backups). All machines are running same version of sql driver 2000.81.9042.00

Two connect just fine all the time. One cannot connect - ever. If we place him into the NT4 domain admin group, he can connect at another machine fine. If he's at his machine - he cannot connect ever.

The same sql account is used on asp pages by non-administrators just fine.

How can I get this guy out of the Domain Admin Group and still have him connect using sql authentication?

Many thanks!

View Replies !
Lost Connection To MySQL During Query In My ODBC Connection
I am trying to connect Visual Studio 2005 here in the Philippines to a MySQL server in CA, USA using the Connector/ODBC using the following parameters:

 

DSN = mysqlodbc

Server = host376.ipowerweb.com

userid = myuid

password = mypassword

 

when i used the port 3036  i got the  can't connect to MySQL on server blabla(10060)

 

when i used the port 8087 i got the "Lost connection to MySQL during query.

 

How do i connect successfully?

 

 

 

 

View Replies !
ODBC Security Processing Fails With 'Missing Password'
Hello,
I have a package that contains an ADO.NET connection mananger using an ODBC provider. There is a user name and password configured in the connection mananger. The connection is to a DB2 database.
 
I install the package on SSIS by setting the package ProtectionLevel to ServerStorage. I then save the package to the server using FileSave Copy of (package name), and save it to the server. I also set the protection level there to use server storage.
 
When I enable package configurations (SQL Server), the package fails when run by a Job. In the log, I get the following error message from the DataReader source that uses the connection manager:
 
******
System.Data.Odbc.OdbcException: ERROR [08001] [IBM][CLI Driver] SQL30082N  Security processing failed with reason "3" ("PASSWORD MISSING").  SQLSTATE=08001       at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager90.AcquireConnection(Object pTransaction)     at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.AcquireConnections(Object transaction)     at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper90 wrapper, Object transaction)
****
The DataReader fails validation. When I disable package configurations, the Job executes the package without a problem. The server that the package runs on is 64 bit.
 
Why do I have this password problem when package configurations are enabled? The connection manager password is include in the package configurations.
 
Thank you for your help!
 
cdun2
 

View Replies !
Backup Fails With Error Message SQL-DMO (ODBC SQLState:42000) - Need Help !!!
Hi,

This is my first posting and actually I have big problem which I need to resolve immediately:

I have a 38 GB Database on my SQL Server which I want to full-backup. Until now backup was created on the same volume where the database resides. But now the volume is out of disk space. So what we did is that we connected an external USB disk drive with 500 GB to the SQL Server and try to backup there.

But our first and all consecutive backup attemps failed with error SQL-DMO (ODBC SQLState: 42000). It's working fine the first few minutes as we can see that the backup file is continously growing. But then it abruptly aborts with above error message.

Can anyone figure out why ? Any help is appreciated.

Thx
Overlord1970

View Replies !
"ODBC--Call Failed" And "ODBC--connection To 'SQLServerMYSERVER' Failed"
We are using Access as a front end to a DB we house on a SQL 2000 SP2 box. I have 2 users utilizing this front end and they keep recieving these two errors
"ODBC--Call Failed" and "ODBC--connection to 'SQLServerMYSERVER' failed"
when trying to run a query window. They get the called failed message 99% of the time. I on the other hand, have no problems doing any of this without a File DSN defined. I verified all the file permissions to rule that out. And I also verified how their permissions were setup in Enterprise Manager and they are set the same as mine. The other users get the errors with or without the File DSN defined. After relinking the tables in the front end, it seems to go away for awhile, but then reappears. The only other way I could get the errors to disappear was to make them a domain admin like myself. When I did that, everything seemed to work fine. Now obviously I can't leave them like that, so I was hoping someone would be able to kindly point me in the right direction on how to resolve this. Please help, I am completely out of ideas here. Thanks in advance. Mike

View Replies !
Db Connection Fails In C#
I have this line of db connection code that works in vb.net but not in c#:
con = new ADODB.ConnectionClass(); //for vb.net I used ADODB.Connection() instead and it workscon.Open("Provider=SQLOLEDB;" + ConfigurationSettings.AppSettings["connectionString"]);
Error message:CS1501: No overload for method 'Open' takes '1' arguments
Searched the web but can't find the answer... Does anyone have a clue?

View Replies !
SQL Connection Fails
Hello,

I'm trying to get a handel on ASP.NET and I've put together a new SQL connection to display a view inside of a datagrid.

When I go to run it (before or after compile) I get the error:

------------------------------------------------------------------------------------------------------

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection

Line 57: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 58: Dim ds As New DataSet
Line 59: SqlDataAdapter1.Fill(ds)
Line 60:
Line 61: DataGrid1.DataSource = ds

Stack Trace:


[SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
jtio8.WebForm1.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootjtio8WebForm1.aspx.vb:59
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()


--------------------------------------------------------------------------------


Here is the connection string I am using:

Me.SqlConnection1.ConnectionString = "workstation id=MyWorkstation;packet size=4096;integrated security=SSPI;data source=MyServer;" & _
"persist security info=False;initial catalog=Northwind"

-------------------------------------------------------------------------------

Now, I've created a new login to the SQL server using the ASPNET user id (as well as several others for testing), set up the premissions for each UID and I'm still getting this error.

I have also tried to setup the user info in the connection string by doing the following:

Me.SqlConnection1.ConnectionString = "user id=aspnet;password=;workstation id=MyWorkstation;packet size=4096;integrated security=SSPI;data source=MyServer;" & _
"persist security info=False;initial catalog=Northwind"

Any ideas?

Thanks,
Dale

View Replies !
ADO Connection Fails
I have an intermittent problem in a ADO application that cannot
connec to a SQL 7.0 server. The error message is similar to,
" USER 'null' is not a trusted login id user etc...... ".
Then a login box appears with the ' trusted connection' option
already selected. If I deselect it and try a standatd login with
a non-existant login id, obviously it fails. But then the interesting
thing is, if I select the' trusted connection ' option again in
the same login box, the connection thsi time is successful.

Any help from any body please?


Thanks.

Ranjit

View Replies !
TCP/IP Connection To SQL 7.0 Fails
Hi,

Recently I read in a listserver message about the bug BUG #: 56445 which causes the TCP/IP connection
to SQL 7.0 SP1 servers to fails and that a fix has been relased. I could however not find any reference
to this bug neither in MSDN not in TechNet. Has anybody seen this anywhere?


Thanks.

Ranjit

View Replies !
OLE DB Connection Fails....!
Dear All,
 
I am using Crystal Report XI to create OLE DB connection to SQL Server 2005 domain user that is already added to database logins and has public and read rights. (Using Integrated Security)
 
but it fails when i try to create.
 
what am I missing, in your opinion.....???
 
Thanks,
 

View Replies !
Report Connection Fails With DNS Name
Hi,

I am facing problem while setting connection string in Report Service project.
Problem is when I specify DNS name instead of machine name as the Server in the connection string.

When I specify DNS name in the connection string it gives error that "A connection cannot be made.Ensure that the server is running" on click of "Test Connection"
Also I am not able to view reports directly through IE. I.e. http://<DNS_NAME>/Reports.
When I access Reports, it prompts me to enter username/password. Even after specifying valid username, it shows me the prompt again n again.

Is there some known issue with Reporting Service or with IIS setting not able to connect to a DNS name? I did not face with any issue when
I specified DNS name in the connection string of Analysis Service project.


Did anyone encountered DNS related problem with SQL Server 2005 Reporting Service?

 

We also verified that:
1: Ping with both machine name and DNS name returns same result.
2: nslookup with both machine name and DNS name resolves to same IP.

3: Tried putting the DNS name in the hosts file.

 

 

Eagerly awaiting some positive reply.

 

Note: I am working with SQL Server 2005 Standard Edition.

View Replies !
VB6 ADO Connection To SQL Server 2K5 Fails
I have a legacy visual basic application that connects to a newly installed SQL Server 2005.  On occasion (about once or twice a day) I will receive several errors in a row about not being able to open a connection to the database.

Since I am catching any errors generated I post the number and description of the Err object to the screen in a message box for notice to the user.  The error is 0 and the description is blank.  There are no corresponding events in Window Event Log or in the SQL Server Logs other than standard informational messages about the regular operation of the server.

I am connecting to a SQL Server 2k5 Workgroup Edition, with ODBC, using named pipes.  The connection works at all other times, so I know I am set up correctly.  The program loops thru the same processing section of code so there is no chance special operations being done on the database could hose the connection.

Thanks for any help.

View Replies !
Connection To Sql Server Fails
Hi

I have a SQL Server that uses mixed mode , I have given it a real IP ....from home when i connect on the dial up & use the EM & then try registering it using the real ip & the sa username & pasword .It says that Access denmied to the SQL Server..... or the server does not exists


There is no firewall ... I am directly connected to the Internet & so is the SQL Box

Can anyone please let me the reason for it & how to solve this problem


Thanks

View Replies !
T-SQL ODBC Connection
Would someone provide a code snip example of a T-SQL script using an ODCB connection against a non-SQL2K database. I can hit the outside database using DTS (so I know it is possible) but I'm having trouble with the parameters using a script.

Thanks,
Fred.

View Replies !
ODBC Connection
I am currently running a application and a database server they are connected via ethernet. Only the application is connected to our network. Is there a way to connect MS Access to the database server without connecting the database server to the network? I've tried several different approaches and it still dosent work. Any help would be greatly appreciated.
Dale

View Replies !
ODBC - ASP Connection
We are upgrading from Access to SQL 2000 for our Intranet backend database. This is on a separate server. I have installed Server 2000 ODBC drivers on the IIS machine. I get the following error message which I can't sort out:

Microsoft OLE DB Provider for ODBC Drivers error 80040e4d
[Microsoft[ODBC SQL Server Driver][SQL Server]Login failed for user 'NT AUTHORITYANONYMOUS LOGON'

The ODBC is set up on the IIS server to use NT Authentication. The account logged on has administrative rights for the domain.

The only solution I can think of is to publish to the MSDE I have installed on the IIS machine.

Anyone out there able to help?

Thanks
Bob

View Replies !
ODBC DSN Connection
By defining a System DSN I can specify a simple ODBC connection string like DSN=SomeDSNname. With some repeated testing I've found that using a trusted connection (NT) in the DSN, I can set up either named pipes or TCP/IP and the connection works fine. When I try to set up SQl server authentication I can only get named pipes to work and not TCP/IP. Any ideas?

View Replies !
ODBC Connection
Hi everyone

I installed the MS SQL server 7.0 on a Windows NT 4.0 SP 4 server. The network runs with TCP/IP.
I want to connect the SQL server by a ODBC-connection. Only a connection on the server (local) was successful.

The odbcping-utility reports following:
COULD NOT CONNECT TO SQL SERVER

SQLState: 08001 Native Error: 6
Info. Message: [Microsoft][ODBC SQL Server Driver][DBNMPNTW]Selected SQL server not found.

SQLState: 01000 Native Error: 53
Info. Message: [Microsoft][ODBC SQL Server Driver][DBNMPNTW]ConnectionOpen (CreateFile()).

Do I forget to install a SQL server component? Or a network service?

Thank you for your help.

Greetings
Steven

View Replies !
ODBC Connection
I have DSN setup on IIS 4.0 server that is configure using TCP/IP connection to talk to SQL Server to retrieve data for one of our web site.

The problem I am having is that the DSN cofiguration connection changes automatically to Named Pipe on the IIS 4.0 server, causing web site to generate ODBC connection failure. This happends at least once a week.

To resolve the issue I have to reconfigure the DSN to TCP/IP connection.

Does any one have any idea how to resolve this issue.

Thank You,
Piyush Patel

View Replies !
ODBC Connection
Has anyone had an issue with the ODBC data source that when you set it up for SQL, it does not retain the username and password you entered and keeps defaulting back to the NT windows verification instead of using the SQL verification that you choose?

I add a datasource, select validation based off of SQL profile/password assigned, enter the user and password I assigned on SQL, go through the setup and test successfully. Then I try to connect using that datasource with my VB application and it says connection failure. When I go back to the datasource, it has changed back to NT verification and removes the user/password I entered for SQL verification. Maybe there is an service pack from MS on this?

any help is appreciated. At the very least, I can just hard code into my VB app, but that is my last resort. Thanks!

View Replies !
Can't See ODBC Connection
I am connecting to Informix via ODBC.  When I go to the ODBC manager, I can create a connection DSN and it tests OK.
When I look at the list of available drivers, there are only 3 in the list
 
When I try to run a report & set up the data source, it can't find the DSN but it shows a lsit of dozens of drivers...none of which are Informix
 
Any insight?
 
Thanks
JPS

View Replies !
ODBC Connection
I have front-end visual basic program that use an ODBC connection to connect with SQL server, and my questions is there any automated procedure to configure this ODBC connection instead of configure it manually specially of the user profiles was changed I have to configure it again.

Please advise

View Replies !
Odbc Connection
We have three users that access a particular sqlserver database via microsoft access, two of the users have no problem, the third user used to be able to use the access database but is now getting  a sql server error 18452 followed by an error message 'login failed for user '(null)' reason: not associated with a trusted sql server connection. When reviewing the odbc setup that the user that is having problems has, we find  two sqlserver entries  when it asks 'which sqlserver do you want'.  How do i go about finding out where that entry comes from so i can look into removing one of them. None of the other users have two sqlserver entries. The othere users have no problem accessing this sqlserver database via  ms access, I'm trying to find out why all of a sudden this one user is having problems

View Replies !
ODBC Connection
Hi,

I just start working on SQL Server 2005, could someone help me to make link of few tables through ODBC.

 

Thanks

AA

View Replies !
ODBC Connection
I am trying to connect to SQL Server using a 3rd party report generating software (dbextra).  Everything is located on my local box.  I am trying to establish connection through ODBC.  Is this installed during setup or is this a function I have to manually set up and configure?

View Replies !
ODBC Connection
Hello - I'm trying to creat an ODBC connection and the db I created is not showing up in the dropdown for 'Change the default database to:' option. I'm logged into SQL using Windows Authentication, create the db, restored it w/ a backup and then added a user w/ no problems. Any ideas?

View Replies !
Connection Pooling Login Fails
Setup:
    Environment: ASP.NET application running on Windows Server 2003 and using SQL Server 2000.
Problem:
    I can log into the app and run through a few
database hits (via user interaction), but around the 4th or 5th time a
sql connection is created I recieve a "Login Failed for user" error
(See top portion of Error Stack Below).  I am including the user
id and password in the connection string (until I migrate to Staging,
at which point I will change to impersonation) and I am using the
Microsoft Data Access Block to retrieve my datasets (so I am pretty
sure that all connections are being closed appropriately). 
    System.Data.SqlClient.SqlException:
Login failed for user 'testuser'.

   at
System.Data.SqlClient.ConnectionPool.CreateConnection()

   at
System.Data.SqlClient.ConnectionPool.UserCreateRequest()

   at
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)

Question:

Does anybody have any ideas as to what could generate this error?  Thanks in advance for your time.

View Replies !
First Connection After SQLServer Restart Fails
Hello everybody.

I'm having an odd issue here. First off, let me tell you I've already spent hours trying to solve this and looking for any similar problem in forums with no luck.

I have a very simple application (built to test this issue) which connects to SQLServer 2K, and retrieves some information from a table. It works fine. Then I stop the server, wait, and bring it up again. When I try to execute the query, it will fail only the first time, and then work.

The application was written in C#.
The exception thrown is "...A transport-level error has occurred when sending the request to the server....".
Please, remember, the server IS up, and working fine. I've also tried variants of this code, not just with select querys, but also insert.. with different objects as well.

I'll post some of this codes, so you can check.
If anyone knows about what may be happening I'd be truly thankfull for your input.

Thank's in advance!

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Text;using System.Windows.Forms;namespace ABMprueba{    public partial class Form1 : Form    {        private SqlConnection conn;        public Form1()        {            conn = new SqlConnection();            conn.ConnectionString = "Server=USER;Database=test;User ID=sa;Password=1234;Application Name=ABMPrueba";            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {            try            {                conn.Open();                SqlCommand cmd = conn.CreateCommand();                cmd.CommandType = CommandType.Text;                cmd.CommandText ="select * from a;";                SqlDataAdapter adapter = new SqlDataAdapter(cmd);                DataSet output = new DataSet();                adapter.Fill(output);                this.dataGridView1.DataSource = output.Tables[0].DefaultView;            }            catch (Exception ex)            {                System.Windows.Forms.MessageBox.Show(ex.Message);            }            finally            {                conn.Close();            }        }    }}


=========================== option 2

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Text;using System.Windows.Forms;namespace ABMprueba{    public partial class Form1 : Form    {        private SqlConnection conn;        public Form1()        {            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {            try            {                conn = new SqlConnection("Server=MBESTEIRO;Database=prue;User ID=sa;Password=barza04;Application Name=ABMPrueba");                conn.Open();                SqlCommand cmd = conn.CreateCommand();                cmd.CommandType = CommandType.Text;                cmd.CommandText = "select * from test;";                SqlDataReader dr = cmd.ExecuteReader();                DataTable dt = new DataTable();                dt.Load(dr);                this.dataGridView1.DataSource = dt.DefaultView;            }            catch (Exception ex)            {                System.Windows.Forms.MessageBox.Show(ex.Message);            }            finally            {                conn.Close();            }        }    }}


=========================== option 3

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Text;using System.Windows.Forms;namespace ABMprueba{    public partial class Form1 : Form    {        private SqlConnection conn;        public Form1()        {            conn = new SqlConnection();            conn.ConnectionString = "Server=MBESTEIRO;Database=prue;User ID=sa;Password=barza04;Application Name=ABMPrueba";            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {            try            {                conn.Open();                          SqlCommand cmd = conn.CreateCommand();                cmd.CommandType = CommandType.Text;                cmd.CommandText = "insert into a values ('John');";                int recordsAffected = cmd.ExecuteNonQuery();            }            catch (Exception ex)            {                System.Windows.Forms.MessageBox.Show(ex.Message);            }            finally            {                conn.Close();            }                    }    }}

View Replies !
OLE DB Connection Fails; Native Client Does Not
I cannot connect to my SQL2005 server using the old SQL ODBC drivers, I have to use the Native client drivers. The database I am trying to connect to is a SQL 2000 db I just attached. Its owner is a SQL user login, which works fine and can connect remotely.

Thoughts?

Possibly related: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=96732

View Replies !
Creating ODBC Connection
In my project, I have added a database called aspnetdb.mdf and I store all the required information here. Now I want to write a seperate Cryatl Report for my manager, that accesses this database and display required data. This report is not a part of the asp.net project. This is only for my manager. My database is not attached to any server. I just use the attachdb in the coonection string of my project to attach this database. no I want my crystal report to access this database. If I can create an ODBC connection to this database, it will solve my problem. Dows any body know how to access this database from Crystal with or without ODBC?
Any help is greatly appreciated.

View Replies !
ODBC Connection Failing
First of all i apologise if this is in the wrong area.  My problem is as follows.  I had set up a couple of aspx pages on our webserver which accessed a sql database on another server.  These pages were set up using frontpage 2003 and everything worked fine.  A week ago the pages stopped working giving the error "Server Error in '/' Application". As far as I know nothing has been changed on the servers.  On top of this frontpage has started having connection problems.  Frontpage will connect to the database but is unable to access the fields giving the following error.
Server error: Unable to retrieve schema information from the record source ' NAME' in a database using the connection string:
'DRIVER={SQL Server};SERVER=servername;DATABASE=live;UID=********;PWD=********'.
The following error message comes from the database driver software; it may appear in a different language depending on how the driver is configured.-------------------------------------------------------[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'NAME'.
Source: Microsoft OLE DB Provider for ODBC DriversNumber: -2147467259 (0x80004005)
 
I have been trying for the past few days to solve this one, but am reasonable new to SQL, so this may be an easy one.
Hope someone can help me

View Replies !
ODBC -Connection Failed
I create a Test database in SQL server, also I add new user in security folder. Also I add this user in Test database, the permission are: Public, and db_owner. But when I let the user try to open the database, it is ODBC – Connection failed. I add another user a few months ago, she works fine. But the new user I added in didn’t work, did you know why. I am sure I add the same permission as the later user. Thanks.

View Replies !
ODBC Connection To SQL Server DB
I'm writing a VB app to read and write data to an SQL server database.

I have successfully done so using ADO however I now need to do it using ODBC.

I have set up the appropriate DSN and have no trouble reading data from the database but when I try to write to it I get a message indicating that the database is open for read only access.

I'm no sure whether the restriction is and the VB, ODBC, or database level.

Here's the code which opens the database and recordset.

Set dbsWarehouseServer = OpenDatabase(ODBCDSName, _
dbDriverNoPrompt, False, _
"DSN=" & ODBCDSName)

Set rstRailSet = dbsWarehouseServer.OpenRecordset("Select Store_date, SLN From " & TBName & " where Rail_set_ID = '" & RailID & "'", dbOpenDynaset)

Any help is greatly appreciated.

View Replies !
Loosing ODBC Connection
Hi all,

We recently converted an application from accecc97 to access2003.
We used to have 2 databases : 1 with all and only the data (axelD.mbd), 1 with all the forms, query's, ... (axelP.mdb)

We replaced the data (axelD.mdb) with an MSDE database, through UPSIZE and so on. That all worked fine.
This database is placed on the dataserver (DATA1), the converted programm is on the FRONT2 server (FRONT1 stil usess access97 until conversion is totally ready).

We are able to connect to the MSDE by using ADODB recordsets.
We are also perfect able to link the MSDEtables in our axelP.mbd database

We started to test some heavier parts of our application and started to get the following error:

"ERROR 3151"
"ODBC--connection to 'JOROSOFT' failed"

Nothing more.

This happened in a quite complex routine, whitch updates a lot of records, several times and so on.
We could reproduce the same error when executing the following code:


Public Function TestBestellingen()
Dim sql As String
Dim intervalset As DAO.Recordset
Dim planset As DAO.Recordset
Dim tellerke

x = Opendatabases()
tellerke = 0
sql = "Select bestelnummer from vkpbestellijn where bestelnummer > 100000"
Set planset = Db_AxelP.OpenRecordset(sql, dbOpenDynaset)
Do While Not planset.EOF
tellerke = tellerke + 1
Debug.Print tellerke & " - " & planset!Bestelnummer & " --> " & IsKlantStof(planset!Bestelnummer)
planset.MoveNext
Loop
End Function

Function IsKlantStof(p_bestelnummer)
Dim sql As String, rst As DAO.Recordset
Dim hulp_klantstof As Boolean

hulp_klantstof = False
x = Opendatabases()
sql = "select klantstof from vkpbestellijn where bestelnummer = " & p_bestelnummer
Set rst = Db_AxelP.OpenRecordset(sql, dbOpenSnapshot)

With rst
Do While Not .EOF
If !KlantStof = True Then
hulp_klantstof = True
.MoveLast
End If
.MoveNext
Loop
End With
rst.Close
Set rst = Nothing
IsKlantStof = hulp_klantstof
End Function

Function Opendatabases()
If Db_AxelP Is Nothing Then
Set Db_AxelP = DBEngine(0)(0)
End If
End Function
I know this code makes no sence in a real-time environment, but it was to reproduce the error.
This code basically runs trough a 30.000 records and does a little check for certain fields
After 1981 records we get the above error.
(sometimes after 1979 or 1980 or 1982 records)


1977 - 100859 --> True
1978 - 100860 --> True
1979 - 100860 --> False
1980 - 100861 --> True
1981 - 100861 --> True


"vkpbestellijn" is a table that is linked in the AxelP.mdb trough an ODBC connection.
We get the same error (and after 1981 times) if I change the where to a totally other range of "bestelnummer"

I have installed the latest patches of Jet 4.0, MSDE-server, ...

I've been searching the internet for abour 3 days now, and just cant even find the smallest clue what could make this happen.

I hope someone here has an idea.
If you need more details, just ask.

tia,
Axel.

P.S. I'm from Belgium, so my english aint "correct to the point".

View Replies !
ODBC Connection Is Not Working
I have these two workstation in same domain.

PC A is running on Windows 2000 Professional, with MSSQL 7.0 installed.

PC B is on Windows XP, in which I try to create an ODBC connection to one database in the above MSSQL server.

When I add a system DSN from the ODBC Data Source Administrator, I couldn't connect with the following message:

---------
Connection failed:
SQLState: '28000'
SQL Server Error: 18456
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'Auserabc'.
---------

I have created the userabc in PC A, both as system adminstrator and as an user permitted to use the database.

I tried both "With windows NT authentication using the network login ID" and "With SQL Server authentication", but both were not working.

Any hint about what may go wrong? Thanks.

View Replies !
ODBC Connection In UNIX
Hi Folks,

I need to access the MSSQL data in Oracle.

For that i need to first create the data source (ODBC Connection) to the MSSQL server on UNIX. Can anybody help me in creating the ODBC connection.

Thanks,
Amit

View Replies !
How To Get ODBC Connection Attributes?
I'm using SQLDriverConnect(Driver=SQL Server) to connect to MS SQL Server 2000/2005.

I want to get the value of the following ODBC connection attributes:

AnsiNPW
AutoTranslate
QuotedID
Regional

1. Which ODBC API functions should I use to get those attributes?
2. Which constants do I pass to the ODBC API functions for those attributes?
3. Which header file (.h) contains the constants?


Thanks.

View Replies !
ODBC Connection Error
Hi,
I'm new to SQL Server, but regularly connect to Oracle via ODBC. I'm trying to a) connect to our SQL Server over an ISP and b) Run Enterprise Manager over the ISP. Both actions work fine over our campus network but fail across an ISP.

The first returns the message: Connection failed:SQLState: '01000' SQL server Error: 1326 [Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionOpen[CreateFile()]. Connection failed:SQLState:'08001' SQLServer Error 1326 [Microsoft][ODBC SQL Server Driver][Client unable to establish connection

The second returns the message: Unable to connect to server [reason:[DB-Library]Unable to connect. SQL Server is unavailable or does not exist. Register anyway.

I had previously received a different error (in case 1) and, through the knowledge Base discovered I needed MDAC drivers for named pipes. I installed them but get a new error. I can find nothing in the KB or previous SWYNK messages.

Please help..... TIA

View Replies !
Connection ODBC Closed
That is an app ACCESS 2000 wih Named Pipe ODBC to SQL Server 6.5.

After 10 minutes without use this app, the connection closed !

Have-you idea for correct this probleme ?
Regards
Alain

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved