Showing posts with label program. Show all posts
Showing posts with label program. Show all posts

Friday, March 30, 2012

ODBC DSN ....

Hello .
im programing a one application
in Delphi . and my program connected to
sql server successfully . but thats not why
im calling . suppose i exported my program ( .exe )
and sell it . as you know in users pc DSN dosnt
exist in odbc . can they open my program without
DSN in their systems ? or i must create DSN File
and export it by Setup in Users pc ?
Help me please . thanks for your worksYou can use dsn-less connections or you could
programmatically create the needed DSN as part of your
setup/install package. I'm not sure how to code it in Delphi
but the following are VB examples that might help you get
started:
HOWTO: Create and Remove a DSN in Visual Basic
http://support.microsoft.com/defaul...b;EN-US;q171146
HOWTO: Programmatically Create a DSN for SQL Server with VB
http://support.microsoft.com/defaul...b;EN-US;q184608
-Sue
On Thu, 4 Dec 2003 01:39:50 -0800, "Toxi_boy"
<stanboy733@.hotmail.com> wrote:
quote:

>Hello .
>im programing a one application
>in Delphi . and my program connected to
>sql server successfully . but thats not why
>im calling . suppose i exported my program ( .exe )
>and sell it . as you know in users pc DSN dosnt
>exist in odbc . can they open my program without
>DSN in their systems ? or i must create DSN File
>and export it by Setup in Users pc ?
>Help me please . thanks for your works
sql

Monday, March 26, 2012

ODBC Data Source to a linked SQL Server

I'd like to set up an ODBC Data Source to a table in a linked SQL
Server, via
my local SQL Server.
When I use the ODBC Data Sources program to set up the ODBC DSN, it
only
shows databases in the local SQL Server, not in the linked one. If I
try typing it in: [NAMEOFLINKEDSERVER].databasename - it tells me that
it is an invalid table.
How can I create an ODBC Data Source which uses a database in the
linked server as its default database?
I've got a similar question. In my case I linked an Oracle database to my
SQL Server 2005 Standard database. I also want to see the tables in the
linked server. I hope someone can answer this for both of us...
Randall Arnold
<listrecv@.gmail.com> wrote in message
news:1137940173.907969.215550@.o13g2000cwo.googlegr oups.com...
> I'd like to set up an ODBC Data Source to a table in a linked SQL
> Server, via
> my local SQL Server.
> When I use the ODBC Data Sources program to set up the ODBC DSN, it
> only
> shows databases in the local SQL Server, not in the linked one. If I
> try typing it in: [NAMEOFLINKEDSERVER].databasename - it tells me that
> it is an invalid table.
> How can I create an ODBC Data Source which uses a database in the
> linked server as its default database?
>

ODBC Data Source to a linked SQL Server

I'd like to set up an ODBC Data Source to a table in a linked SQL
Server, via
my local SQL Server.
When I use the ODBC Data Sources program to set up the ODBC DSN, it
only
shows databases in the local SQL Server, not in the linked one. If I
try typing it in: [NAMEOFLINKEDSERVER].databasename - it tells me that
it is an invalid table.
How can I create an ODBC Data Source which uses a database in the
linked server as its default database?I've got a similar question. In my case I linked an Oracle database to my
SQL Server 2005 Standard database. I also want to see the tables in the
linked server. I hope someone can answer this for both of us...
Randall Arnold
<listrecv@.gmail.com> wrote in message
news:1137940173.907969.215550@.o13g2000cwo.googlegroups.com...
> I'd like to set up an ODBC Data Source to a table in a linked SQL
> Server, via
> my local SQL Server.
> When I use the ODBC Data Sources program to set up the ODBC DSN, it
> only
> shows databases in the local SQL Server, not in the linked one. If I
> try typing it in: [NAMEOFLINKEDSERVER].databasename - it tells me that
> it is an invalid table.
> How can I create an ODBC Data Source which uses a database in the
> linked server as its default database?
>

Wednesday, March 21, 2012

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

YOu either could use a connection string for connecting instead of using a dsn, or you use an UDL file which is already configured for the appropiate parameters.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

As Jens said, you could use a DSN. An example of using this via SQLConnect( ) is on:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcsqlconnect.asp.

Regardless of your connection method, you won't be able to store your user ID and password in the DSN. This would be a great security risk anyway. You could make the connection use a trusted connection, and rely on NT authentication to validate the user.

|||

Mohamed Hussein Kotat wrote:

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

Try with string "ODBC; DSN=name_dsn; UID=sa; PWD=password_sa; DATABASE=database_name"

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

YOu either could use a connection string for connecting instead of using a dsn, or you use an UDL file which is already configured for the appropiate parameters.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

As Jens said, you could use a DSN. An example of using this via SQLConnect( ) is on:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcsqlconnect.asp.

Regardless of your connection method, you won't be able to store your user ID and password in the DSN. This would be a great security risk anyway. You could make the connection use a trusted connection, and rely on NT authentication to validate the user.

|||

Mohamed Hussein Kotat wrote:

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

Try with string "ODBC; DSN=name_dsn; UID=sa; PWD=password_sa; DATABASE=database_name"

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

YOu either could use a connection string for connecting instead of using a dsn, or you use an UDL file which is already configured for the appropiate parameters.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

As Jens said, you could use a DSN. An example of using this via SQLConnect( ) is on:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcsqlconnect.asp.

Regardless of your connection method, you won't be able to store your user ID and password in the DSN. This would be a great security risk anyway. You could make the connection use a trusted connection, and rely on NT authentication to validate the user.

|||

Mohamed Hussein Kotat wrote:

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

Try with string "ODBC; DSN=name_dsn; UID=sa; PWD=password_sa; DATABASE=database_name"

ODBC connect styring does not work

Porting a C Db-library program to ODBC connectivity for Sql Server 2000 SP4.When SQLDriverConnect(hdbc, GetDesktopWindow(), "DSN=HOST_ODBC_DB;UIDDBMS=usercode2;PWDDBMS=password2;", SQL_NTS, NULL, 0, NULL, SQL_DRIVER_COMPLETE) is used, a dialog window pops up. I enter the password and successfully connect to Sql Server 2000. Of course the usage of SQL_DRIVER_COMPLETE is causing the above "UIDDBMS=usercode2;PWDDBMS=password2;" to be ignored in the connect string.If instead the above connect string is used with SQL_DRIVER_NOPROMPT rather than SQL_DRIVER_COMPLETE the following errors are received:[28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. (18452)[01S00] [Microsoft][ODBC SQL Server Driver]Invalid connection string attribute (0)What is causing this?What is the server working on, only on Windows Authentication or on Mixed Authentication, the (null) indicated that its using Windows Authentication but did not get the credentials from the client because either the client passed SQL Server credentials or the Windows account could not be passed.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de
|||

The database server is configured for both Windows and database server authentication. The original Db-library C program version can connect using either authentication type.

The ODBC ported C program version can connect using a Windows authentication connect string with: SQLDriverConnect(hdbc, GetDesktopWindow(), "DSN=host_ODBC", SQL_NTS, NULL, 0, NULL, SQL_DRIVER_NOPROMPT.

It cannot connect using a database server authentication connect string of "DSN=host_ODBC_DB;UIDDBMS=usercode2;PWDDBMS=password2".

The host_ODBC odbc data source was configured for Windows authentication. The host_ODBC_DB odbc data source was configured for database server authentication.

Why does database server authentication fail?|||

Which ODBC driver do you use?

Can you try using "UID" and PWD" instead of "UIDDBMS" and "UIDPWD"?


This posting is provided "AS IS" with no warranties, and confers no rights.

Monday, March 19, 2012

ODBC communication link failure to SQL server

Okay-- if anyone can solve this they are truly the SQL genius! We are getting this error when we run a VB program that we use to access an SQL database on a server across our network on a workstation. In fact we get this same error when we even run the program on the server where the SQL database is running or on any of our workstations. Here is the error message:

08501:[Micorsoft][odbc sql server driver] communications link failure

Now the odd thing is that many other functions in the workstation application work fine and retrieve data from SQL but certain data requests by the workstation application fail with the above error message and we get this message consistently. Even though it appears that different workstations running the identical Vb application will get this error consistently but in different locations when running the application. We were running SQL 6.5 on an old server, with the workstation application for literally years without any problems. We also decided to upgrade to a new server, installed server 2000 operating system and the latest version of SQl -- moved all the databases pointed the workstations odbc at this new server and get exactly the same error in the same location in the workstation applications. The programmer that wrote the application and designed the database in SQL can't find the problem and a number of other computer "experts" also could not find the error. We did add a new linksys DSL router/firewall but everything kept working after this installation for several weeks so I don't know if this is the problem on the network. THe programmer also noted that he had problems using terminal services on our network to connect to his office computer and decided that there must be some network issues that are causing the ODBC communicaitions to fail and also terminal services to fail-- or of course they may be unrelated. Has anyone ever seen this ODBC communication error in their travels through SQL implementations? Any help will be greatly appreciated. If we can't fix this we will have to abandon a software application that has been used for over five years and just too complex to rewrite.

Jeff KilpatrickWell, this challenge is not really for a "true DBA", simply because it's related to ODBC driver for SQL Server. Link failure may be caused by several things, including improper closing of resultsets without notifying the server that no more records are needed. The definition ofthe error is:

The communication link between the driver and the data source to which the driver was connected failed before the function completed processing.

And that's what you need to investigate. The reason why it worked with 6.5 may be as simple as the version of the driver. So all the seeming mysteries are probably lying right in there.|||Not playing around with Windows XP SP2, are you?

Anyway, It sounds as though there is an ODBC DSN set up on each of these machines. Go through the configuration of this DSN on one of the affected machines, and see if the test connection button comes back successfully. If it is successful, then you may be looking at a client (i.e. VB Application) problem.

If the test is successful, have the programmer assemble all of his connection strings. If any of them specify PROVIDER as one of the attributes, then you may have your suspect. An ODBC DSN specifies PROVIDER and DATA SOURCE for most connection strings it is used in. Most often, it also specifies DATABASE. I have not experimented with it so much that I know if a connection string can override the DSN, or not, but it is worth a check. For this line of questioning, it would help if you could identify what functions seem to be erroring out. If it is random on each machine, and each attempt, then this will be a pain to figure out.

Another place to check is to make sure you have at least MDAC 2.7 on all of the machines. If you have applied SQL SP3 to the SQL box, then that box at least should have MDAC 2.7 sp1, I think. Microsoft has an MDAC version checker available on their website.

Hope this helps.|||We recently moved from an older (SQL 7 I think) server to SQL2000. Our VB application was using a DNS pointer to point to the SQL server.

This no longer worked once we moved the data to the SQL2000 server. As the poster above mentioned, I ran across a suggestion to run the MDAC patch. There is actually a newer version out now MDAC 2.8. I first ran this on my desktop and then we had to push it out and install it on all the clients which needed to connect to the new server.

Once we did that, we were able to connect to the SQL 2000 server without any problems using the DNS pointer.

A note, with ODBC, the pointer will not show up on your server list, you have to just type it in manually.

odbc communication link failure

Hello,

I have a problem in ODBC that when I open a call logging program, it display "08S01 communication link failure. However, the connection between the driver and data source (in Sydney) is ping ok and data source test successful.

My PC os : window xp professional sp2

ODBC drvier version : 2000.85.1117.00

Can anyone help me to solve the problem ?

Thanks

Rex Leung

Rex,

Could share out the exact error message from your odbc driver when connect fails? Also, is your server name instance and default instance. Is it listened on TCP or NP. can you connect to the server from the same machine. What exactly the connection string you were using for the local odbc connection?

Thanks,

ODBC BCP Error Handling in C++

(Please let me know if there is a better group to post this on...)
I have written a C++ program that BCP's data into SQL Server using ODBC.
I'm currently at the point that I am testing worst-case scenarios. In the
scenario that while the BCP is running, I pull the network cable from SQL
server, I get failed calls to bcp_sendrow, but I am unable to get details on
the error. I have tried calling SQLGetDiagRec with handle types of
SQL_HANDLE_ENV, SQL_HANDLE_DBC, and SQL_HANDLE_STMT.
Any suggestions would be appreciated.
Thanks.
-Thomas
I figured it out myself. In case anyone is interested, here is how to
determine whether the connection to the database is still alive...
SQLHDBC m_hConn;
...
SQLINTEGER siDead = SQL_CD_FALSE;
::SQLGetConnectAttr(m_hConn
,SQL_ATTR_CONNECTION_DEAD
,&siDead //SQL_CD_TRUE or SQL_CD_FALSE
,sizeof(siDead)
,NULL);
if (siDead == SQL_CD_TRUE)
{
//Database connection is dead
}

ODBC BCP Error Handling in C++

(Please let me know if there is a better group to post this on...)
I have written a C++ program that BCP's data into SQL Server using ODBC.
I'm currently at the point that I am testing worst-case scenarios. In the
scenario that while the BCP is running, I pull the network cable from SQL
server, I get failed calls to bcp_sendrow, but I am unable to get details on
the error. I have tried calling SQLGetDiagRec with handle types of
SQL_HANDLE_ENV, SQL_HANDLE_DBC, and SQL_HANDLE_STMT.
Any suggestions would be appreciated.
Thanks.
-ThomasI figured it out myself. In case anyone is interested, here is how to
determine whether the connection to the database is still alive...
SQLHDBC m_hConn;
..
SQLINTEGER siDead = SQL_CD_FALSE;
::SQLGetConnectAttr(m_hConn
,SQL_ATTR_CONNECTION_DEAD
,&siDead //SQL_CD_TRUE or SQL_CD_FALSE
,sizeof(siDead)
,NULL);
if (siDead == SQL_CD_TRUE)
{
//Database connection is dead
}

ODBC API Bulk Update Question

Hi all,
Quick question - I'm writing a program that uses the ODBC API to bulk load
data into SQL Server. I have nailed the Bulk Insert, no problems. Now I
need to use Update By Bookmark, but am having trouble. Does anyone know
where I can find ODBC Update By Bookmark samples? The SQL BulkOperations
sample application on MSDN is inadequate, incomplete and buggy.
ThanksNever mind, figured it out, works great.
"Michael C" wrote:
> Hi all,
> Quick question - I'm writing a program that uses the ODBC API to bulk load
> data into SQL Server. I have nailed the Bulk Insert, no problems. Now I
> need to use Update By Bookmark, but am having trouble. Does anyone know
> where I can find ODBC Update By Bookmark samples? The SQL BulkOperations
> sample application on MSDN is inadequate, incomplete and buggy.
> Thanks

Monday, March 12, 2012

odbc + sql problem

Anyone could please help me ?
I have a simple asp program connecting to sql7.0.
I have the system dsn setup already.
After I transfer everything from the old hard disk to new hard disk, I
cannot login through asp program anymore. Below is the error message but I
don't know why it has to do with the iusr account. Thanks a lot. (any image
of setup would be helpful)
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for
user
'CENTRAL\IUSR_CENTRAL'.So, the error message is that this user:
doesn't exist as a SQL login.
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for
user
'CENTRAL\IUSR_CENTRAL'.
175671 PRB: 80004005 ConnectionOpen (CreateFile()) Error Accessing SQL
http://support.microsoft.com/?id=175671
307002 PRB: ASP/ODBC/SQL Server Error 0x80040E4D "Login Failed for User
http://support.microsoft.com/?id=307002
176380 How To Use ASP with a SQL Trusted Connection with Guest Account
http://support.microsoft.com/?id=176380
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Friday, February 24, 2012

obtain a date from week data

Hi all,

I have a problem with date functions...

In my program I use weeks, and with this variable I need to know which is the first day of the selected week...

For example... I put week 52 in my program... how I can obtain the first day of this week? -> (22/12/2003).

I have proved with this functions...

SET DATEFIRST 1 (to configure Monday as first day of week)

SELECT DATEADD(ww,DATEDIFF(ww,0,GETDATE()),0)

With this I have the day of the current week... but I can't put my week in this function... aarrgggg.

Please help me...

Thanks a lot.declare @.week tinyint, @.firstdate varchar(4)
-- Choose the week number
set @.week = 30
-- Choose the year
set @.firstdate = '2003-01-01'
select dateadd(day, (datepart(weekday, @.firstdate) - 1) * -1, dateadd(week, @.week, @.firstdate))|||Originally posted by joejcheng
declare @.week tinyint, @.firstdate varchar(10)
-- Choose the week number
set @.week = 30
-- Choose the year
set @.firstdate = '2003-01-01'
select dateadd(day, (datepart(weekday, @.firstdate) - 1) * -1, dateadd(week, @.week, @.firstdate))|||Simply Outstanding ... why did I not think of it first ?? :)