'MSDASQL' Headache

Aug 10, 2006

Hello - hope this is in the right group:

We have just started with linked servers and have successfully created
a view on SQL Server linked to a Progress database. I can query this
view happily in Query Analyzer.

I have created an ASP.NET application to display this view in a
datagrid but I get the following error:

System.Data.SqlClient.SqlException: OLE DB provider 'MSDASQL' reported
an error. at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption
exception, Boolean breakConnection) at
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection) at
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior
runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaDat a() at
System.Data.SqlClient.SqlDataReader.get_MetaData() at
System.Data.SqlClient.SqlCommand.FinishExecuteRead er(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString) at
System.Data.SqlClient.SqlCommand.RunExecuteReaderT ds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
async) at
System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method, DbAsyncResult result) at
System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method) at
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
behavior, String method) at
System.Data.SqlClient.SqlCommand.ExecuteDbDataRead er(CommandBehavior
behavior) at
System.Data.Common.DbCommand.System.Data.IDbComman d.ExecuteReader(CommandBehavior
behavior) at System.Data.Common.DbDataAdapter.FillInternal(Data Set
dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords,
String srcTable, IDbCommand command, CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at...

The code in my ASP.NET application looks fine and works on non-linked
views on the same server. Do I need to add a command or change a
setting on SQL Server?

View 2 Replies


ADVERTISEMENT

64-bit MSDASQL

May 6, 2008

Hi,

I got the 64-Bit MSDASQL through the following link and install it on Windows xp 64-bit:
http://www.microsoft.com/downloads/details.aspx?FamilyID=000364db-5e8b-44a8-b9be-ca44d18b059b&displaylang=en

But

_bstr_t strConnect="Provider=MSDASQL;Driver={Microsoft Access Driver (*.mdb)};Dbq=C:/test/test.mdb;";

// create Connection object

m_pConnection.CreateInstance("ADODB.Connection");

hr =m_pConnection->Open(strConnect,"","",NULL);
...

I always get the error "Data source name not found and no default driver specified". I'm sure the test.mdb file exists and the code works well on windows xp 32-bit but fails on Window xp 64-bit even I install the above package. Anybody can help me? Thanks!!

View 9 Replies View Related

64 Bit MSDASQL.DLL

Feb 17, 2007

Is microsoft going to provide 64 bit version of MSDASQL ( OLEDB Wraper for ODBC) in future? This was working great while accessing Data from IBM AS/400 on Iseries from 32 bit sql 2000. Now, it's all screwed up with rediculously slow OLEDB both from MS and IBM. I wonder if any of these guys really care!

View 30 Replies View Related

MSDASQL Errors

Dec 18, 2002

I am having this problem with using a linked server to another dB. I can read tables from the server, but cannot update the same tables (permissions are ok). I get the message

The requested operation could not be performed because the OLE DB provider 'MSDASQL' does not support the required transaction interface

Does anyone have an idea where I should start looking? What interface are they talking about? I am linking with a system DSN running the Connx 8.3 driver.

Any help would be extremely aprreciated.

Robert Crooks
Ivaco Rolling Mills

View 1 Replies View Related

MSDASQL Problem...

May 2, 2007

Hi,I have some MSDASQL database files and I don't know this database at all.Can I get from somewhere SQL standard for this database?Greg.--

View 1 Replies View Related

64BIT MSDASQL

Nov 1, 2007

Hi, is here someone who can send me new dll libary. Itīs very important. Thanks ALL

View 1 Replies View Related

Can Anyone Help Me With This? It's Giving Me A Bad Headache!

Mar 9, 2005

Hi All,

I have a table called Prizes. Here's how it looks in design view with some value placed inside for Illustration purposes.

PrizeID 1, 2, 3, 4, 5
PromotionID 1, 1, 1, 2, 1
PrizeName 10 Cash, 5 cash, 10 cash, 15 cash, 20 cash

My challenge is that I need to write a stored procedure for example, that will find the PrizeID associated with the 4th count of the PromotionID that equals 1 . So in this example, counting to the 4th PromotionID that equalls 1 give us a PrizeID of 5.

I hope I've made myself clear! Can anyone write out a mini SP on how to do this.

Many many thanks in advance,
Brad

View 2 Replies View Related

Syntax Headache!!!

Mar 13, 1999

I need to get this statement to run.

Declare @MiD datetime

-- The ATime is a datetime field in the table
-- @OrderBy is an input Parameter also, as is @MiD

SELECT @Statement = 'SELECT tblAudit.* FROM tblAudit WHERE ATime >= ' + @MiD + ' ORDER BY ' + @OrderBy
EXECUTE(@Statement)

@Statement then contains:

SELECT tblAudit.* FROM tblAudit WHERE ATime >= Mar 10 1999 ORDER BY Access_ID

I need the quotes around the Mar 10 1999.

Thanks for the help

View 2 Replies View Related

SQL Query Headache

Jun 24, 2004

Hallo

I am interrogating the structure of SQL Server database looking for the occurence of a particular phrase in the object names/definitions. This is in preparation for decommission/replacement...

When I run the script below in SQL Query Analyzer it returns about 200 results, but when I run the same query in my Access VBA code it returns much less!

SQL Script:
SELECT
so.ID,
so.name,
so.type,
CHARINDEX('insita',so.name) AS PosInObjName,
CASE WHEN CHARINDEX('insita',so.name) > 0 THEN 1 ELSE 0 END AS FoundInObjName,
CHARINDEX('insita',sc.text) AS PosInObjDef,
CASE WHEN CHARINDEX('insita',sc.text) > 0 THEN 1 ELSE 0 END AS FoundInObjDef
FROM
sysobjects so INNER JOIN syscomments sc on so.id = sc.id
ORDER BY [name]

VB Code:
Sub InterrogateDatabaseStructure(sServer As String, sDB As String, sSearch4 As String)
On Error GoTo err_IDS
Dim oCnn As ADODB.Connection
Dim oCmd As ADODB.Command
Dim oRs As ADODB.Recordset
Dim sSQL As String

Set oCnn = New ADODB.Connection
oCnn.ConnectionString = "driver={SQL Server};server=" & sServer & ";uid=;pwd=;database=" & sDB & ";dsn=;"
oCnn.Open

CurrentDb.Execute "DELETE * FROM PhraseSearchResults"
CurrentDb.Execute "DELETE * FROM PhraseInObjName"

Set oCmd = New Command
oCmd.ActiveConnection = oCnn
oCmd.CommandType = adCmdText
sSQL = "SELECT so.ID, so.name, so.type, "
sSQL = sSQL & "CASE WHEN CHARINDEX('" & sSearch4 & "',so.name) > 0 THEN 1 ELSE 0 END AS FoundInObjName,"
sSQL = sSQL & "CHARINDEX('" & sSearch4 & "',so.name) AS PosInObjName, "
sSQL = sSQL & "CASE WHEN CHARINDEX('" & sSearch4 & "',sc.text) > 0 THEN 1 ELSE 0 END AS FoundInObjDef, "
sSQL = sSQL & "CHARINDEX('" & sSearch4 & "',sc.text) AS PosInObjDef "
sSQL = sSQL & "FROM " & sDB & ".dbo.sysobjects so INNER JOIN syscomments sc on so.id = sc.id"

oCmd.CommandText = sSQL
Set oRs = oCmd.Execute()

With oRs
If Not .EOF And Not .BOF Then
.MoveFirst
Do Until .EOF
sSQL = "INSERT INTO PhraseSearchResults VALUES('"
sSQL = sSQL & .Fields(0) & "','" & .Fields(1) & "','" & .Fields(2) & "',"
sSQL = sSQL & .Fields(3) & "," & .Fields(4) & ")"
CurrentDb.Execute sSQL
.MoveNext
Loop
End If
End With


Set oCmd = Nothing
Set oCnn = Nothing

Exit Sub

err_IDS:
MsgBox "Error: " & Err.Description & vbCr & "Error Code: " & Err.Number
Screen.MousePointer = 0
End Sub

Can anyone please advise what I am doing wrong? Thanks.

View 1 Replies View Related

Date Headache

Dec 5, 2005

Guys
I have a table 1 row, a start and end date of a period

create table xperiod(startdate datetime , enddate datetime)
insert xperiod (startdate , enddate)
values ('2004-04-01 00:00:00.000' , 2012-03-31 00:00:00.000)

I'm trying to retrieve a batch of 'smaller' periods from this where the relevant period is a number (of months) passed as a parameter (only ever 1, 3 or 6)


for example, if the parameter is 1 I will obtain the following rows each being a 1 month period starting at the xperiod.startdate value up to an end date of the xperiod.enddate value
startperiod endperiod
'2004-04-01 00:00:00.000' '2004-04-30 00:00:00.000'
'2004-05-01 00:00:00.000' '2004-05-31 00:00:00.000'
'2004-05-01 00:00:00.000' '2004-05-31 00:00:00.000'

and so on to
'2012-03-01 00:00:00.000' '2012-03-31 00:00:00.000'


if the parameter is 3 I will obtain the following rows each being a 3 month period starting at the xperiod.startdate value up to an end date of the xperiod.enddate value


startperiod endperiod
'2004-04-01 00:00:00.000' '2004-06-30 00:00:00.000'
'2004-07-01 00:00:00.000' '2004-09-30 00:00:00.000'
'2004-10-01 00:00:00.000' '2004-12-31 00:00:00.000'

and so on to
'2012-01-01 00:00:00.000' '2012-03-31 00:00:00.000'

Hope this makes sense !

I think I'll be ok on the logic for the while loop but my main problem is getting the endperiod value based on the startperiodvalue
Thx in advance

View 2 Replies View Related

Beta Headache

May 3, 2006

Hi Folks,

I'm still using the the SQL Server 2005 June CTP to develop. I'm working for a client that intends to upgrade, but has not done so yet. We believed that we had 365 days from the date of installation before it would expire (late July). But Visual Studio 2005 Beta 2 just expired, which is used by SQL Server Business Intelligence Development Studio, so now we can no longer develop SSIS packages or Reporting Services reports.

What can I do?

I thought that maybe installing Visual Studio 2005 express might work, but when I went there, it seems that it is split up into modules (e.g. Visual Basic 2005 express, Visual C++ express, etc...). I don't know if just one of these would be sufficient and if so, which one. Even if it would, it says I'll need to completely remove the SQL Server 2005 beta, as well as the Visual Studio 2005 beta, and I think the .net framework.

My contract is up at the end of June, and it was understood that the client was going to take care of the upgrade. Is there a quick fix here? What can I do with minimal effort? (I don't really have time to wait for the client to get the upgrade approved and done. I know, sniff, sniff! lol.)

View 1 Replies View Related

MSDASQL To NOTESSQL (odbc)

Jul 23, 2005

Within an SQL Script is it possible to send a SQLDisconnectcommand? (server is MSDE)I have used sp_dropserver, sp_droplinkedsrvloginand do not get a SQLDisconnect.Each time I run the script a new nsql32.exe process loads up and theyaccumulate.use SalesGosp_dropserver 'M', 'Droplogins'goExec sp_addlinkedserver 'M', ' ', 'MSDASQL', NULL, NULL,'DRIVER=Lotus NotesSQL DRIVER(*.nsf);Database=C:eUROPEInstrument_Base.nsf;Ser ver=Local;UserName=XXXXXXXXXXXXX;EncryptPWD=XXXXXX X;'goselect * from M...MainForm where description= 'Described Here'Would like disconnect when this is done.......

View 2 Replies View Related

Help!! Need To Get The MSDASQL Provider In SQL 2005 EE 64 Bit

Aug 20, 2007



I understand that the MSDASQL.dll is not available in 64 bit (unless you are running 2008 beta 3). I also understand that you can setup 32 bit ODBC without issues (using ODBCAD32.exe in WOW directory). My issue is how does SQL 2005 64 bit see these ODBC links? What is everyone doing to get around this? I want to be able to use openquery. Any advice would be much appreciated.

Carlton

View 6 Replies View Related

The OLE DB Provider MSDASQL Has Not Been Registered.

Feb 8, 2007

I'm trying to set up replication on SQL Server 2005 (64-bit) and I am getting this error message when the replication kicks off.

'The OLE DB provider "MSDASQL" has not been registered.'



When I try and register the MSDASQL I get the folloing error message.

'LoadLibrary("c:program filesCommon FilesSystemole dbMSDASQL.dll") failed - the specified module could not be found.



View 3 Replies View Related

Object Ownerships Headache

Dec 10, 2005

This is more of an SQL server question than ASP.net.
A stored proc named MyStoredProc is created by admin account (sa) thus the owner of that proce is dbo.
When I log in to the database (Query Analyzer) as another login say User1, I can not use that stored proc since it was owned by sa. I get an error 'Invalid Object Name' or Object does not exist.
If I use the proper name qualifier like dbo.MyStoredProc, It works in the Query analyzser.
The problem I am facing is - My stored procedures, Views, Tables  were created by sa on the development machine. Now its time for deployment. On the deployment machine, I am not the sa. I just belong to the db_Owner role. I have to log in as User1 and not as sa.  In my c# code I have called the stored procedure as MyStoredProc. I get an error 'MyStoredProc does not exist' since I am loging in as User1 and not sa. In order to use the code, I have to change the ownership to this (and all other objects) to User1.
Is that the only way out or I am doing something wrong/missing someting? Your coments/opinions/suggestions welcome.
 

View 1 Replies View Related

Help Constructing A Headache Query...

Sep 28, 2005

I have two tables, both with phone numbers and call times.

one is for incoming calls, one for outgoing calls.

I need to find all phone numbers from the incoming calls table where the number of calls exceeds 100 within the last 30 days, where the last call was within the last 15 mins, and where the number does Not exist in the outgoing call table within the last 30 days.

so far I have this...
(call record is the incoming, callout is the outgoin)

I believe this is giving me all records in the call record table that are within the last month, and not in the outgoing call table OR have not ben called within the last month..

SELECT cr.cli,min(cr.starttime)as "first call",max(cr.starttime)as "last call",count(cr.cli) as "number of calls"
FROM callrecord cr
LEFT JOIN callout co
ON cr.cli = co.cli
where (co.cli is null or datediff(dy,co.calltime,getdate())>30 )
and datediff(dy,cr.starttime,getdate())>30
group by cr.cli
order by cr.cli


i need to add in the 15 minute call check, and also only return those with a count of > 100

can anyone assist? i'm getting a headache :D

tia

a

View 4 Replies View Related

Group By, Creating A Headache

Oct 12, 2006

I am using SQL server 2000.
While using query analyzer I am facing problem.
If a query has group by clause and if that query is not fetching any record (i.e. query is returning nothing), then in this situation, I want zero to be displayed where datatype of field is integer and "-" if datatype of field is varchar.

Please give me solution as soon as possible, a kind request.

Facing problem for the below mentioned query:-

select IsD.ItemCode,
case
when sum(IsD.IssuedQty) is null then 0
else sum(IsD.IssuedQty)
end as IssuedToday
from Inv_IssueMaster IsM, Inv_IssueDetail IsD
where IsM.IssueNo=IsD.IssueNo
group by IsD.ItemCode

In the above mentioned query, datatype of IssuedQty is int and for ItemCode it's varchar.

View 14 Replies View Related

Snapshot Replication Headache

Jan 4, 2006

Hello,
Harry Half wit here!!
I know that snapshot replication is the simplest form of syncing with SQL server and I can't even figure that out today!!.
I keep getting myself confused as to who should be configured to be a publisher, distibutor or subscriber etc etc.
My scenario is simple:
1 server creating a daily snapshot of a table and then 1 remote laptop (msde) pulls the snapshot into it's own database.
Heres what i did so far;
I configured the server to be a publisher and distributor (is that right?) and didn't set up any subscribers because i want to do that from my remote.
From the remote I did nothing but go into EM tools"create new pull subscription" but I cannot see the publication on the server.

SHould I set my remote to be a distributor to do this?

any help very much appreciated!!

View 1 Replies View Related

Reporting Express Headache

Oct 12, 2006

hi all,

i am having a hell of a time trying to understand how im supposed to use the reporting services integrated with sql server 2005 express - advanced. i have searched high and low throughout vb 2005 express for the relevant controls, and i have searched the management studio trying to find the relevant information. there is no reporting server anywhere that i can see. i simply installed the sqlexpr_adv.exe and assumed that all the relevant features would be automatically installed. i cant find them anywhere (also something about a business intelligence thing? also missing). i would be extremely grateful if somebody could help me

regards

adam

View 2 Replies View Related

'MSDASQL' Error On Linked Servers

Dec 16, 2003

I've seen several posts on linking an AS/400 to a SQL 2000 server.

I have created the link, I can use DTS packages to get data to/from the AS/400 to the SQL Server. However, I cannot write any SQL statements against the AS/400. Here is a basic one that doesn't work...

Select * from openquery(jdedwardspy, 'Select * from mhscrp.f0006')

If you look quickly enough, you can see that it does return a row or so, but then that is replaced by this error...


[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver (32-bit)]Driver not capable.]

We're running Client Access V5R2, SQL Server 2000 SP3 and MDAC 2.7.1.

Any suggestions?

View 4 Replies View Related

MSDASQL Linked Server Error

Jan 7, 2008

Hi all,

I have created a System DSN to a MYOB database file. I have SQL 2000 and 2005 Express editions installed on the same machine. I am logged in to PC as Local Admin. I am also logged into 2005 Express using 'sa' to avoid any security problems.

Creating a New Linked Server using SQL 2000 works fine using the System DSN I created, however, If I use exactly the same settings (Microsoft OLE DB Provider for ODBC) I get an error message.

"The OLE Provider "MSDASQL" for linked server "sname" reported an error. The provider did not give an information about the error."
"Cannot initilize the data source object of OLE DB Provider "MSDASQL" for Linked Server "name". (Microsoft SQL Server, Error: 7399)"

I have installed SL 2005 Express SP2.

As another test I created a data source using the same System DSN in Excel. It worked fine and queries the MYOB database file.

Any ideas to assist me??

Thanks.

Alan

View 5 Replies View Related

DateTime Param For SP Causing BIG Headache...!!

Aug 8, 2006

I've got a stored procedure and one of the parameters is a DateTime.  But no matter what I do to the string that's passed into the form for that field, it doesn't like the format.  Here's my code: SqlConnection conn = new SqlConnection(KPFData.getConnectionString());
SqlCommand cmd = new SqlCommand("KPFSearchName", conn);
cmd.CommandType = CommandType.StoredProcedure;

SqlParameter param = cmd.Parameters.Add("@DOB", SqlDbType.SmallDateTime);
param.Direction = dir;
param.Value = txtDOB.Text;

// also have tried this:

param.Value = Convert.ToDateTime(txtDOB.Text);

// and

param.Value = Convert.ToDateTime(txtDOB.Text).ToShortDateString;

No matter what I do I always get a formatting error - either I can't convert the string to a DateTime, or the SqlParameter is in the incorrect format, or something along those lines.  I've spent a couple hours on this and hoping someone can point out my obvious mistake here...??Thanks for your help!!eddie

View 5 Replies View Related

Subquery Headache With Count And GroupBy

Nov 23, 2005

I'm trying to return an integer from the following table that returnsthe number of unique cities:tblEmployeesName CityJohn BostonFrank New YorkJim OmahaBetty New YorkThe answer should be 3.DECLARE @EmployeeCities intSELECT @EmployeeCities = SELECT ... ???How go I return one row/column into @EmployeeCities from a Count and aGroupBy?Headache already... Maybe it's too early...

View 3 Replies View Related

Linked Server Headache (Access)

Aug 13, 2007

There seems to be a lot of confusion around the groups about linkingto an Access mdb with the SQL Server Jet OLE DB provider and I haventbeen able to find a straight forward solution. Basically, I have anAccess MDB (A2K) on one server and a SQL Server DB (2005 std ed.) onanother - Both on the same network. I'm trying to create a linkedserver object in the SQL server to view data in the mdb. I've set itup and it works - but only from the server machine itself. If you tryto connect the the linked server from any other computer on thenetwork you get the usual access denied / file in use error.The fact that I can use the linked server from the server box itselfbut not from another pc on the network makes me think that it may be apermissions problem. But I am logging in with full Admin rights andstill no joy. Also there is no workgroup security on the mdb, so thatsnot the problem. I've used the surface editor to remove anyrestrictions that may cause problems, OLE DB connect, OPENROWSET etc.but still no joy.I've tried mapping the mdb's location on the server so I could use astandard filepath, rather than a //Server-Name/... path. Again, worksfrom the server, but not from any client PCs, so no joy there either.In frustration, I copied the mdb to the same server and viola - fullaccess to the linked server from anywhere. But this is no good, I needthe mdb file to stay where it is. An mdb full of linked tables wontwork... they don't show up in the linked server.So that's it - out of ideas! Am I just going to have to accept thatlinked server objects are limited just to mdb files on the same servermachine, or is there something I'm missing??? Firewalls, servicelogins, server settings.... something one of you gurus out there knowabout that might be the key to making my headache go away!!!Any input gratefully recieved!!!

View 1 Replies View Related

Index Tuning Wizard - Headache

Jul 20, 2005

Hi,I am having problems getting anything useful out of the index tuningwizard.I have created a table and inserted data into it. When i run the indextuning wizard i expect 2 indexes to be recommended so the book says(Index011 with a key on the uniqueid column and a non clustered indexnamed table02 with a key on the col03 and LongCol02)Instead i get nothing being recommended.What am i doing wrong????Please helpMaryamif exists (select name from dbo.sysobjects where name ='table01' andtype ='u')drop table table01create table table01(uniqueid int identity, longcol02 char(300)DEFAULT 'THIS IS THE DEfault column',col03 char(1))godeclare @counter intset @counter =1while @counter<=1000begininsert table01 (col03) values('a')insert table01 (col03) values('b')insert table01 (col03) values('c')insert table01 (col03) values('d')insert table01 (col03) values('e')insert table01 (col03) values('f')set @counter=@counter+1end

View 3 Replies View Related

MSDASQL Error Requires SQL Service Restart

May 17, 2006

I am having trouble with a linked server using MSDASQL.  I'm connecting to a PostgreSQL database and pulling over data.  This process has been working fine.

In trying to pull data from a different client database (same schema), I received an error that the MSDASQL couldn't read the column names.

The actual problem I want help on is that after this happens, I am no longer able to make valid connections to any of my Linked Servers using MSDASQL.  The only way I can get my other linked servers to work again is to restart the SQL Service.  Usually this is impossible for me to do because of the number of active users.

Two questions:

1) Is there another way to restart a more targeted service or sub-set to reset MSDASQL connections, and clear out my problem?

2) Any idea why I'm getting this error connecting to PostgreSQL on a large dataset when it worked fine for a small dataset using the same linked server? "The provider reported an unexpected catastrophic failure."

Any help is appreciated.

View 4 Replies View Related

SQL Server 2005 DTS Conversion, Activex And MSDASQL

Mar 29, 2006

Hi all

I am migrating some DTS2000 packages to SSIS via the migration wizard. However there is an activex script in each DTS that connects to an AS400 to retrieve record count for integrity checking. Under SQL server 2000 this worked fine but now it errors with "The OLE DB provider "MSADSQL" has not been registered" how do i get this to work i suspect its because this is a 32 bit dll and my new system is a 64bit sql server on windows 2003. The odbc driver for the as400 has been installed also. The script is as follows:

dim cn 'sql connection
dim rs 'sql recordset for the insertion of new as400 records
dim insertstr 'sql insert string
dim rs1 'sql recordset for the insertion of new as400 records
dim insertstr1 'sql insert string

set cn = createobject("ADODB.Connection")
set rs = createobject("ADODB.Recordset")

Function Main()
'set up connection for sql
cn.provider="sqloledb"
cn.commandtimeout = 3600 'timeout in seconds
cn.open %sqlserver05%, %user%, %password%

'populate temporary table in sql with recordset from as400 odbc
insertstr1 = "Insert into db.dbo.%table% select 'table name',a.* from openrowset ('MSDASQL','DRIVER={Client Access ODBC Driver (32-bit)};SYSTEM=%system name%;UID=%username%;PWD=%password%','SELECT count(*) from %table%') as a"

set rs1 = cn.execute (insertstr1)

'close all objects
cn.close
Main = DTSTaskExecResult_Success
End Function

Does anyone know how i change this to work under sql server 2005. i need to resolve this quickly in order to deliver a project on time. Many thanks

Chris

View 6 Replies View Related

VERY Large Binary Import/export Headache

Oct 13, 2006

Hi,

I am currently importing (and exporting) binary flat files to and from Db fields using the TEXTPTR and UPDATETEXT (or READTEXT for export) functions. This allows me to fetch/send the data in manageable packet sizes without the need to load complete files into RAM first.

Given that some files can be up to 1Gb in size I am keen to find out a new way of doing this since the announcement that TEXTPTR, READTEXT and UPDATETEXT are going to be removed from T-SQL.

I had a quick foray into SSIS but couldn't find anything suitable which brings me back to T-SQL. If anyone knows a nice elegant way of doing this and is prepared to share, that would be grand.

Thanks for your time,
Paul

View 9 Replies View Related

Catastrophic Failure, MSDASQL, Linked Servers And MySQL

Jun 21, 2007

When executing a query which joins against a large resultset from a linked server, SQL Server reports the following error:
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "foo" reported an error. The provider reported an unexpected catastrophic failure.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "foo".

This is using SQL Server 2005 with SP2, and MyODBC version 3.51.16 (although previous versions also seem to have the same behavior).

Once the error occurs any subsequent query against the linked server (even something as simple as select top 3 * From foo...users) fails with the same error message. Queries using the OpenQuery syntax also fail with this error.

I've tried to determine if there are some error logs that might give me more insight into what's going on, but the above events don't seem to log to the ODBC trace logs. And I can't seem to figure out a way to trace the MSDASQL (i.e., oledb) events.

I initially thought there might be a problem with the MySQL myODBC driver, but the ODBC layer itself does not seem to have a problem. But the following steps indicate otherwise:
1. Create a new Linked Server to MySQL. Same error as above
2. Execute a query against the ODBC DSN directly, using a shell program. This works fine

I'm trying to clearly identify if the problem is with the MySQL driver or with the MSDASQL provider. It would appear that the latter is at fault, given the error message, and the lack of any ODBC logging.

Would anyone have any insights about what might be going on here, and if there is any possible resolution?

View 3 Replies View Related

Intermittent Openquery Error ..The OLE DB Provider 'MSDASQL' Indicates That The Object Has No Columns..

Jul 20, 2005

Help,I am running a pass through query to oracle from SQL server 2000 asfollows;select * from openquery(nbsp, 'select * from FND_FLEX_VALUES')I have run this query through both DTS and the query analyzer and getthe foloowing error;Server: Msg 7357, Level 16, State 2, Line 3Could not process object 'select * from FND_FLEX_VALUES'. The OLE DBprovider 'MSDASQL' indicates that the object has no columns.OLE DB error trace [Non-interface error: OLE DB provider unable toprocess object, since the object has no columnsProviderName='MSDASQL',Query=select * from FND_FLEX_VALUES'].The really strange thing is, I'll get this error the first time Iexecute the query but if I execute it immeadiatley after it will runfine.Any help would be most appreciated!Cheers

View 1 Replies View Related

SQl 2005 Express - Linked Server - Access ADP - MSDASQL Error

Jan 8, 2008

Hi everyone,

I'v finally managed to get a New Linked Server setup on SQL 2005 Express SP2 using the 'Microsoft OLE DB Provider for ODBC Drivers' MSDASQL. I have a Database setup on the SQL 2005 Express Database Engine which contains a query that OPENQUERY's the linked server. The query executes OK.

The problems in when I link an Access 2003 SP2 .adp file to the SQL 2005 Database Engine database. All objects, including the query containing the OPENQUERY (to the linked server) appear. However, when I run the same query within Access I get the following error:

"The OLE DB Provider for Linked Server "name" reported an error."
"The Provider reported an unexpected catastropic failure"

So the query works running within SQL 2005 Management Studio, but the same query doesn't work running within an Access 2003 SP2 ADP. I've closed down SQL 2005 Management Studio, but the same error is displayed.

I didn't know if the problem lies in Access 2003 SP2 or SQL 2005 Express SP2.

Any takers?? (I haven't logged this Thread in an Access forum)

Any assistance is appreciated.

Alan

View 1 Replies View Related

Multiple Left Joins (2 Left Joins 1 Big Headache)

Sep 1, 2005

Hi All,

Im having a problem with a statement i cannot seem to get 2 left joins working at the same time 1 works fine but when i try the second join i get this error:-

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'children_tutorial.school_id=schools.idx LEFT JOIN regions ON children_tutorial.region_id=region.idx'.


My SQL statment is as follows :-
SELECT children_tutorial.*,schools.schoolname,regions.rname FROM children_tutorial LEFT JOIN schools ON children_tutorial.school_id=schools.idx LEFT JOIN regions ON children_tutorial.region_id=region.idx

I am using an Access database i have tried all sorts to get it working and its driving me mad!! any help would be really appreciated.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved