Showing posts with label odbc. Show all posts
Showing posts with label odbc. Show all posts

Monday, March 19, 2012

ask for ASP connection string to ODBC

do anyone know the connection string for ASP connect to ODBC?
i have created an ODBC for MSSQL named "DMZ-SQL" already.
Thank you very much!!I have an example for DSN-less connection via ADO, so u don't have to always create your Data Source Name in the ODBC properties everytime u move your development.

Set DBConn = Server.CreateObject("ADODB.Connection")
DBConn.Open "Driver={SQL Server};SERVER=127.0.0.1;UID=sa;PWD1234=;DATABASE= Mydatabase"|||Thank you very much!

ASE ODBC 12.5 Driver has problem with SQLServer 8.0 DTS: HELP!

Hi,

On one side, I have a Sybase 12.5 32 bits Server running on AIX 5.1
(maintenance level 3). On the other, I've got W2000 5.00.2195 (SP2)
with SQL Server Standard Edition, Product Version 8.00.534 (SP2),
having installed MDAC 2.6.

I connect to the Sybase 12.5 database using Merant ASE ODBC driver for
Sybase 12.5, and using the Microsoft OLE DB Provider for SQL Server
that comes with this SQLServer version.

I try to pump over data from Sybase to SQLServer to one table at a
SQLServer user database, using a package containing a select statement
on a View on the Sybase Server side, using an ODBC 12.5 System DSN
pointing to the Sybase server. All privileges are set correctly on
either side and the ODBC datasource test gives an 'OK' on trying to
reach the Sybase Server.

When I do PREVIEW, I get a resultset alright, however, when I actually
run the package as a scheduled job, its keeps on running infinitely
until manually killed. No data at all is inserted in the the SQLServer
table.

Strange thing is, the same processes is running without any
complications on a W2000 5.00.2195 (SP3), MDAC 2.7 system, with the
same SQLServer connecting to the same Sybase Server but using Merant
ASE ODBC 12.0 instead of ODBC 12.5.

How come?

Any help will be greatly appreciated.

Martijn RutteSame permissions for the SQL Server Agent account ?

http://support.microsoft.com/?kbid=269074

--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

"Martijn Rutte" <opales@.zonnet.nl> wrote in message
news:80634782.0311110348.6e386e95@.posting.google.c om...
> Hi,
> On one side, I have a Sybase 12.5 32 bits Server running on AIX 5.1
> (maintenance level 3). On the other, I've got W2000 5.00.2195 (SP2)
> with SQL Server Standard Edition, Product Version 8.00.534 (SP2),
> having installed MDAC 2.6.
> I connect to the Sybase 12.5 database using Merant ASE ODBC driver for
> Sybase 12.5, and using the Microsoft OLE DB Provider for SQL Server
> that comes with this SQLServer version.
> I try to pump over data from Sybase to SQLServer to one table at a
> SQLServer user database, using a package containing a select statement
> on a View on the Sybase Server side, using an ODBC 12.5 System DSN
> pointing to the Sybase server. All privileges are set correctly on
> either side and the ODBC datasource test gives an 'OK' on trying to
> reach the Sybase Server.
> When I do PREVIEW, I get a resultset alright, however, when I actually
> run the package as a scheduled job, its keeps on running infinitely
> until manually killed. No data at all is inserted in the the SQLServer
> table.
> Strange thing is, the same processes is running without any
> complications on a W2000 5.00.2195 (SP3), MDAC 2.7 system, with the
> same SQLServer connecting to the same Sybase Server but using Merant
> ASE ODBC 12.0 instead of ODBC 12.5.
> How come?
> Any help will be greatly appreciated.
> Martijn Rutte|||Hi Allan,

Exactly the same permissions.

Martijn

"Allan Mitchell" <allan@.no-spam.sqldts.com> wrote in message news:<uQQgTvEqDHA.360@.TK2MSFTNGP12.phx.gbl>...
> Same permissions for the SQL Server Agent account ?
> http://support.microsoft.com/?kbid=269074

Sunday, March 11, 2012

AS400 ODBC connection

I was able to successfully create a linked server to AS400 box without
any problem. But now, due to some reason the following query does not
return any data (0 rows)
Select * from openQuery(CWBIS800, 'select * from lib.tb where cmln =
10001001')
whereas the following query does return the correct record.
Select * from openQuery(CWBIS800, 'select * from lib.tb') where cmln =
10001001
I dont like the later query as this basically fetches all the records
from as400 (network traffic) and then applies the where clause on SQL
server side. Any idea how to fix the previous query ? please help
Sandeep Khandelwal
KeyBank
What is the data type for cmln? Did you try the first query
- exactly what is in between the single quotes - using
Client Access or on the AS400 itself?
-Sue
On 17 Sep 2004 12:47:53 -0700, Sandeep.khandelwal@.gmail.com
(Sandeep) wrote:

>I was able to successfully create a linked server to AS400 box without
>any problem. But now, due to some reason the following query does not
>return any data (0 rows)
>Select * from openQuery(CWBIS800, 'select * from lib.tb where cmln =
>10001001')
>whereas the following query does return the correct record.
>Select * from openQuery(CWBIS800, 'select * from lib.tb') where cmln =
>10001001
>I dont like the later query as this basically fetches all the records
>from as400 (network traffic) and then applies the where clause on SQL
>server side. Any idea how to fix the previous query ? please help
>
>Sandeep Khandelwal
>KeyBank

Thursday, March 8, 2012

AS/400 Parameters

Connected to AS/400 server through ODBC. Can submit queries, just built a matrix report, looks good.

However I want to incorporate a Parameter and have tried prefacing the parameter COSTCENTER with everything under the sun:

@.COSTCENTER (SQL Server version of parameter declaration)

:COSTCENTER (Oralce version of parameter declaration)

%COSTCENTER

#COSTCENTER

etc. etc.

I keep getting the same error:

Error in WHERE clause near '@.'. Unable to parse query text.

My inquiries are as follows:

1. Can you use parameters with an AS/400 connection?

2. If yes, howshould the parameter be declared?

I searched BOL, GOOGLE, so far nothing...

Which ODBC driver are you using?

AS/400 Parameters

Connected to AS/400 server through ODBC. Can submit queries, just built a matrix report, looks good.

However I want to incorporate a Parameter and have tried prefacing the parameter COSTCENTER with everything under the sun:

@.COSTCENTER (SQL Server version of parameter declaration)

:COSTCENTER (Oralce version of parameter declaration)

%COSTCENTER

#COSTCENTER

etc. etc.

I keep getting the same error:

Error in WHERE clause near '@.'. Unable to parse query text.

My inquiries are as follows:

1. Can you use parameters with an AS/400 connection?

2. If yes, howshould the parameter be declared?

I searched BOL, GOOGLE, so far nothing...

Which ODBC driver are you using?

AS/400 Linked Server Error

Hello,
I have installed IBM AS/400 Client Access on my machine and then added a new
ODBC Data Source.
I have been working with this ODBC connection on several DTS packages and
everything has worked just fine.
Right now, I need to access some information on my AS/400 server from
several stored procedures on my SQL Server. I already configured a Linked
Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
Driver.
When I click the Tables folder under the new linked server, I can browse
through all the tables on the 400 Database. But when I execute any query
(using OPENQUERY or 4-part names in a normal query) I get the following error:
*******************************************+++
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32 bits)] Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returned
0x80004005: ].
******************************************
Why is this happening? What is the error? Is there anything I am doing
wrong? I have been "fighting" with this problem for several hours.
Thanks a lot, in advance, for all the help you can give me.
is your ib client access the most updated version?
"Gabriel Giraldo" wrote:

> Hello,
> I have installed IBM AS/400 Client Access on my machine and then added a new
> ODBC Data Source.
> I have been working with this ODBC connection on several DTS packages and
> everything has worked just fine.
> Right now, I need to access some information on my AS/400 server from
> several stored procedures on my SQL Server. I already configured a Linked
> Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
> Driver.
> When I click the Tables folder under the new linked server, I can browse
> through all the tables on the 400 Database. But when I execute any query
> (using OPENQUERY or 4-part names in a normal query) I get the following error:
> *******************************************+++
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'MSDASQL' reported an error.
> [OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
> (32 bits)] Driver not capable.]
> OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returned
> 0x80004005: ].
> ******************************************
> Why is this happening? What is the error? Is there anything I am doing
> wrong? I have been "fighting" with this problem for several hours.
> Thanks a lot, in advance, for all the help you can give me.
>
|||Hi,
0x80004005 usually has something to do with permission issues. You might
want to check that out first.
Regards,
Steve
"Gabriel Giraldo" <GabrielGiraldo@.discussions.microsoft.com> wrote in
message news:C84D15C4-6087-4377-B66B-1F4C3EDEF7C2@.microsoft.com...
> Hello,
> I have installed IBM AS/400 Client Access on my machine and then added a
> new
> ODBC Data Source.
> I have been working with this ODBC connection on several DTS packages and
> everything has worked just fine.
> Right now, I need to access some information on my AS/400 server from
> several stored procedures on my SQL Server. I already configured a Linked
> Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
> Driver.
> When I click the Tables folder under the new linked server, I can browse
> through all the tables on the 400 Database. But when I execute any query
> (using OPENQUERY or 4-part names in a normal query) I get the following
> error:
> *******************************************+++
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'MSDASQL' reported an error.
> [OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
> (32 bits)] Driver not capable.]
> OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows
> returned
> 0x80004005: ].
> ******************************************
> Why is this happening? What is the error? Is there anything I am doing
> wrong? I have been "fighting" with this problem for several hours.
> Thanks a lot, in advance, for all the help you can give me.
>

AS/400 Linked Server Error

Hello,
I have installed IBM AS/400 Client Access on my machine and then added a new
ODBC Data Source.
I have been working with this ODBC connection on several DTS packages and
everything has worked just fine.
Right now, I need to access some information on my AS/400 server from
several stored procedures on my SQL Server. I already configured a Linked
Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
Driver.
When I click the Tables folder under the new linked server, I can browse
through all the tables on the 400 Database. But when I execute any query
(using OPENQUERY or 4-part names in a normal query) I get the following erro
r:
****************************************
***+++
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express O
DBC Driver
(32 bits)] Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows retur
ned
0x80004005: ].
****************************************
**
Why is this happening? What is the error? Is there anything I am doing
wrong? I have been "fighting" with this problem for several hours.
Thanks a lot, in advance, for all the help you can give me.is your ib client access the most updated version?
"Gabriel Giraldo" wrote:

> Hello,
> I have installed IBM AS/400 Client Access on my machine and then added a n
ew
> ODBC Data Source.
> I have been working with this ODBC connection on several DTS packages and
> everything has worked just fine.
> Right now, I need to access some information on my AS/400 server from
> several stored procedures on my SQL Server. I already configured a Linked
> Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
> Driver.
> When I click the Tables folder under the new linked server, I can browse
> through all the tables on the 400 Database. But when I execute any query
> (using OPENQUERY or 4-part names in a normal query) I get the following er
ror:
> ****************************************
***+++
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'MSDASQL' reported an error.
> [OLE/DB provider returned message: [IBM][Client Access Express
ODBC Driver
> (32 bits)] Driver not capable.]
> OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows ret
urned
> 0x80004005: ].
> ****************************************
**
> Why is this happening? What is the error? Is there anything I am doing
> wrong? I have been "fighting" with this problem for several hours.
> Thanks a lot, in advance, for all the help you can give me.
>|||Hi,
0x80004005 usually has something to do with permission issues. You might
want to check that out first.
Regards,
Steve
"Gabriel Giraldo" <GabrielGiraldo@.discussions.microsoft.com> wrote in
message news:C84D15C4-6087-4377-B66B-1F4C3EDEF7C2@.microsoft.com...
> Hello,
> I have installed IBM AS/400 Client Access on my machine and then added a
> new
> ODBC Data Source.
> I have been working with this ODBC connection on several DTS packages and
> everything has worked just fine.
> Right now, I need to access some information on my AS/400 server from
> several stored procedures on my SQL Server. I already configured a Linked
> Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
> Driver.
> When I click the Tables folder under the new linked server, I can browse
> through all the tables on the 400 Database. But when I execute any query
> (using OPENQUERY or 4-part names in a normal query) I get the following
> error:
> ****************************************
***+++
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'MSDASQL' reported an error.
> [OLE/DB provider returned message: [IBM][Client Access Express
ODBC Driver
> (32 bits)] Driver not capable.]
> OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows
> returned
> 0x80004005: ].
> ****************************************
**
> Why is this happening? What is the error? Is there anything I am doing
> wrong? I have been "fighting" with this problem for several hours.
> Thanks a lot, in advance, for all the help you can give me.
>

Wednesday, March 7, 2012

AS/400 Linked Server Error

Hello,
I have installed IBM AS/400 Client Access on my machine and then added a new
ODBC Data Source.
I have been working with this ODBC connection on several DTS packages and
everything has worked just fine.
Right now, I need to access some information on my AS/400 server from
several stored procedures on my SQL Server. I already configured a Linked
Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
Driver.
When I click the Tables folder under the new linked server, I can browse
through all the tables on the 400 Database. But when I execute any query
(using OPENQUERY or 4-part names in a normal query) I get the following error:
*******************************************+++
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32 bits)] Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returned
0x80004005: ].
******************************************
Why is this happening? What is the error? Is there anything I am doing
wrong? I have been "fighting" with this problem for several hours.
Thanks a lot, in advance, for all the help you can give me.is your ib client access the most updated version?
"Gabriel Giraldo" wrote:
> Hello,
> I have installed IBM AS/400 Client Access on my machine and then added a new
> ODBC Data Source.
> I have been working with this ODBC connection on several DTS packages and
> everything has worked just fine.
> Right now, I need to access some information on my AS/400 server from
> several stored procedures on my SQL Server. I already configured a Linked
> Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
> Driver.
> When I click the Tables folder under the new linked server, I can browse
> through all the tables on the 400 Database. But when I execute any query
> (using OPENQUERY or 4-part names in a normal query) I get the following error:
> *******************************************+++
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'MSDASQL' reported an error.
> [OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
> (32 bits)] Driver not capable.]
> OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returned
> 0x80004005: ].
> ******************************************
> Why is this happening? What is the error? Is there anything I am doing
> wrong? I have been "fighting" with this problem for several hours.
> Thanks a lot, in advance, for all the help you can give me.
>|||Hi,
0x80004005 usually has something to do with permission issues. You might
want to check that out first.
Regards,
Steve
"Gabriel Giraldo" <GabrielGiraldo@.discussions.microsoft.com> wrote in
message news:C84D15C4-6087-4377-B66B-1F4C3EDEF7C2@.microsoft.com...
> Hello,
> I have installed IBM AS/400 Client Access on my machine and then added a
> new
> ODBC Data Source.
> I have been working with this ODBC connection on several DTS packages and
> everything has worked just fine.
> Right now, I need to access some information on my AS/400 server from
> several stored procedures on my SQL Server. I already configured a Linked
> Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
> Driver.
> When I click the Tables folder under the new linked server, I can browse
> through all the tables on the 400 Database. But when I execute any query
> (using OPENQUERY or 4-part names in a normal query) I get the following
> error:
> *******************************************+++
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'MSDASQL' reported an error.
> [OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
> (32 bits)] Driver not capable.]
> OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows
> returned
> 0x80004005: ].
> ******************************************
> Why is this happening? What is the error? Is there anything I am doing
> wrong? I have been "fighting" with this problem for several hours.
> Thanks a lot, in advance, for all the help you can give me.
>

Monday, February 13, 2012

Arithmetic error

When I run a view, I am getting an SQL (ODBC) error "Arithmetic overflow
error converting real to data type numeric." Below is the line of code in
the view that I think is causing the error (dbo.WorkerTimesheets.PayRate is
a real data type and has a value of 730). Can anyone help me fix it?
Thanks.
CONVERT(varchar(6), CONVERT(decimal(4, 2), dbo.WorkerTimesheets.PayRate)) +
'/' + dbo.PayRateCodes.RateName AS txtPayRate
DavidOf course it overflows. You reserve 4 places for the entire numeric, 2 of
which are decimal places.
730 already takes up 3 places. Add 2 for decimals to that and you get 5.
Give it more room. :) I'd suggest using decimal(12, 2). If this is used to
store wages or salaries, 8 places is more than enough. :)
Spend more time reading BOL.
ML|||Geez! When I said 8 I meant 10. Yes, it's late...|||Do not use CONVERT() when you have CAST(). Never use FLOAT or REAL
unless you know what you are doing. There are all kinds rounding
errors and they display with the 'E' format.
Why are you converting numerics to strings? The first rule of a tiered
architecture is that you never do formatting in the database.
Re-do your pay rates with DECIMAL() data type; you do not bill to 16
decimal places, do you? . Read up on floating point numbers.|||You are all correct. The "overflow" was my brain. When I look at it
now, it makes sense.
David
*** Sent via Developersdex http://www.examnotes.net ***