Monday, March 26, 2012
ODBC datasource / dataset problem
I'm using the Visual Studio designer to create my RS reports. When I
add a new project to the solution, the new project wizard allows me to
choose ODBC as the datasource type I want to use. However, I amn't
given the ODBC option when I try to add a datasource to an existing
project. I work around this by copying and manually editing the ODBC
.rds file that was created by the new project wizard. Does anyone know
"the right way" to add an ODBC datasource to a project without using
the project wizard? I'm a bit concerned about my workaround because I
now have multiple .rds files in the same project with the same
<DataSourceID>.
Also, I don't know if this problem is caused by my workaround, but when
I use the "hacked" .rds file as a report's datasource and open the
"Data" tab I see the message:
"The query could not be loaded. Verify your connection string and query
string"
The report still runs fine, and if I open the "Generic Query Designer"
(in the "Data" tab), the query appears, and returns results if I click
the "!" button.
Thanks in advance,
DonRight click on shared data sources, add new data source. When the data link
properties box comes up it is on the connection tab, click on the Provider
tab where you can now pick ODBC.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Don" <donalmurtagh@.yahoo.co.uk> wrote in message
news:1127296726.880744.15570@.g44g2000cwa.googlegroups.com...
> Hi,
> I'm using the Visual Studio designer to create my RS reports. When I
> add a new project to the solution, the new project wizard allows me to
> choose ODBC as the datasource type I want to use. However, I amn't
> given the ODBC option when I try to add a datasource to an existing
> project. I work around this by copying and manually editing the ODBC
> .rds file that was created by the new project wizard. Does anyone know
> "the right way" to add an ODBC datasource to a project without using
> the project wizard? I'm a bit concerned about my workaround because I
> now have multiple .rds files in the same project with the same
> <DataSourceID>.
>
> Also, I don't know if this problem is caused by my workaround, but when
> I use the "hacked" .rds file as a report's datasource and open the
> "Data" tab I see the message:
> "The query could not be loaded. Verify your connection string and query
> string"
> The report still runs fine, and if I open the "Generic Query Designer"
> (in the "Data" tab), the query appears, and returns results if I click
> the "!" button.
>
> Thanks in advance,
> Don
>
Wednesday, March 21, 2012
ODBC Connection
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
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
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"
Monday, March 19, 2012
ODBC --Call Failed exception in application?
I've written a neat little app in Visual C# that connects to an MSAccess 2003 database. Because of the really great functionality of ADO.NET, I was able to circumvent a lot of the concurrent connection limitations of Access by using DataSets - alas, I was only delaying the inevitable transition to SQL Server 2000
Since the internal dataset fills in my C# app are written for OLE, and since I've already configured it to connect to the Access database, I was really hopingthat I could just use a linked table to the exported data on SQL Server. However, when I did just this, I got a "ODBC --Call Failed" unhandled exception in my application when I tried to make a simple data change and save it back to the database - no other descriptive error numbers or anything. It appears to be connecting, as I can navigate records, I just cannot make a single change to them, or add new records.
- The changes I made do not propogate, so the MSKB regarding ODBC and cursors isn't the solution
- I did remember to set a PK when I exported from Access to SQL Server 2000
- It's {most likely?} not a permissions issue; I'm in as Administrator, with the ODBC connection set up to use NT Authentication
- I've got SQL Server 2000 running SP3a as well as the latest version of JET running on my 2k3 Server
Any help would be greatly appreciated!
Hi,
as long as Access doenst have a primry key defined on the table it isn′t able to do an update / insert. Try to open the access database and insert a new row in th linked table, i guess it is greyed. Define a PK on the appriate columns and you′ll be fine.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||Jens,Thanks for the response. Unfortunately, I had already defined the PK, and it's showing up in Access. I can add records/edit changes in the database using the MSAccess UI... it's just when my C# ADO.NET app tries to do connect to the MS Access file that the problems start manifesting.
Any other ideas?
|||
http://support.microsoft.com/?scid=kb;en-us;303257&spid=2509&sid=49
HTH
ODBC --Call Failed exception in application?
I've written a neat little app in Visual C# that connects to an MSAccess 2003 database. Because of the really great functionality of ADO.NET, I was able to circumvent a lot of the concurrent connection limitations of Access by using DataSets - alas, I was only delaying the inevitable transition to SQL Server 2000
Since the internal dataset fills in my C# app are written for OLE, and since I've already configured it to connect to the Access database, I was really hopingthat I could just use a linked table to the exported data on SQL Server. However, when I did just this, I got a "ODBC --Call Failed" unhandled exception in my application when I tried to make a simple data change and save it back to the database - no other descriptive error numbers or anything. It appears to be connecting, as I can navigate records, I just cannot make a single change to them, or add new records.
- The changes I made do not propogate, so the MSKB regarding ODBC and cursors isn't the solution
- I did remember to set a PK when I exported from Access to SQL Server 2000
- It's {most likely?} not a permissions issue; I'm in as Administrator, with the ODBC connection set up to use NT Authentication
- I've got SQL Server 2000 running SP3a as well as the latest version of JET running on my 2k3 Server
Any help would be greatly appreciated!
Hi,
as long as Access doenst have a primry key defined on the table it isn′t able to do an update / insert. Try to open the access database and insert a new row in th linked table, i guess it is greyed. Define a PK on the appriate columns and you′ll be fine.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||Jens,Thanks for the response. Unfortunately, I had already defined the PK, and it's showing up in Access. I can add records/edit changes in the database using the MSAccess UI... it's just when my C# ADO.NET app tries to do connect to the MS Access file that the problems start manifesting.
Any other ideas?
|||
http://support.microsoft.com/?scid=kb;en-us;303257&spid=2509&sid=49
HTH
Monday, March 12, 2012
Odbc and deployment
preview just fine in Visual Studio 2003. However, when I deploy the reports,
open Report Manager, and select a report to run I get:
An error has occurred during report processing. (rsProcessingAborted) Get
Online Help
Cannot create a connection to data source 'DataSource1'.
(rsErrorOpeningConnection) Get Online Help
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found
and no default driver specified
I'm wondering why the datasource doesn't work on deployment (the Odbc driver
is a "User" dsn). Everything is on my "localhost" machine.
Any help is appreciated. Thanks,
BillReport Services user is not you. Make your ODBC dsn a machine dsn and your
problem will go away.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Bill H" <BillH@.discussions.microsoft.com> wrote in message
news:1342D1A4-6D41-4BAD-A165-451130EB714A@.microsoft.com...
> I've created several reports, using ODBC to an external data source, and
> they
> preview just fine in Visual Studio 2003. However, when I deploy the
> reports,
> open Report Manager, and select a report to run I get:
> An error has occurred during report processing. (rsProcessingAborted) Get
> Online Help
> Cannot create a connection to data source 'DataSource1'.
> (rsErrorOpeningConnection) Get Online Help
> ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found
> and no default driver specified
> I'm wondering why the datasource doesn't work on deployment (the Odbc
> driver
> is a "User" dsn). Everything is on my "localhost" machine.
> Any help is appreciated. Thanks,
> Bill|||I have the same problem. My dsn is a system dsn but it still won't work when
I deploy... same error message as described below. Any other ideas? Is it
anything to do with the windows accounts used by the relevant IIS folders?
Rob
"Bruce L-C [MVP]" wrote:
> Report Services user is not you. Make your ODBC dsn a machine dsn and your
> problem will go away.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "Bill H" <BillH@.discussions.microsoft.com> wrote in message
> news:1342D1A4-6D41-4BAD-A165-451130EB714A@.microsoft.com...
> > I've created several reports, using ODBC to an external data source, and
> > they
> > preview just fine in Visual Studio 2003. However, when I deploy the
> > reports,
> > open Report Manager, and select a report to run I get:
> >
> > An error has occurred during report processing. (rsProcessingAborted) Get
> > Online Help
> > Cannot create a connection to data source 'DataSource1'.
> > (rsErrorOpeningConnection) Get Online Help
> > ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found
> > and no default driver specified
> >
> > I'm wondering why the datasource doesn't work on deployment (the Odbc
> > driver
> > is a "User" dsn). Everything is on my "localhost" machine.
> >
> > Any help is appreciated. Thanks,
> >
> > Bill
>
>|||Check out the credentials tab of your data source.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Rob Sykes" <RobSykes@.discussions.microsoft.com> wrote in message
news:255CDDC7-811D-4DDF-B963-4391BE127640@.microsoft.com...
>I have the same problem. My dsn is a system dsn but it still won't work
>when
> I deploy... same error message as described below. Any other ideas? Is
> it
> anything to do with the windows accounts used by the relevant IIS folders?
> Rob
> "Bruce L-C [MVP]" wrote:
>> Report Services user is not you. Make your ODBC dsn a machine dsn and
>> your
>> problem will go away.
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>>
>> "Bill H" <BillH@.discussions.microsoft.com> wrote in message
>> news:1342D1A4-6D41-4BAD-A165-451130EB714A@.microsoft.com...
>> > I've created several reports, using ODBC to an external data source,
>> > and
>> > they
>> > preview just fine in Visual Studio 2003. However, when I deploy the
>> > reports,
>> > open Report Manager, and select a report to run I get:
>> >
>> > An error has occurred during report processing. (rsProcessingAborted)
>> > Get
>> > Online Help
>> > Cannot create a connection to data source 'DataSource1'.
>> > (rsErrorOpeningConnection) Get Online Help
>> > ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not
>> > found
>> > and no default driver specified
>> >
>> > I'm wondering why the datasource doesn't work on deployment (the Odbc
>> > driver
>> > is a "User" dsn). Everything is on my "localhost" machine.
>> >
>> > Any help is appreciated. Thanks,
>> >
>> > Bill
>>
ODBC - SQL Server 200 - MFC - Visual C++.NET (2003)
My problem is:
In Sql Server I made a table "Nir" with 3 columns:
Nr_crt - numeric
Val_TVA - numeric
Val_Tot - numeric
In SQL Server the command:
SELECT SUM(Val_TVA) AS Val_TVA, SUM(Val_Tot) AS Val_Tot FROM Nir - returned
me a result with 2 sums... OK!
My question is:
In Visual C++ - MFC I don't know how can to execute this command and to get
the result return by this comand (may be with a VARIANT - pvRecord I don't
know)
How to access the result return by this command''
I use CDatabase and CRecordset.
Thank You very much!Create a CRecordset, then execute the SQL statement on it. Then you have
can use GetFieldValue on the recordset grab the results in CDBVariants.
"Florin" <Florin@.discussions.microsoft.com> wrote in message
news:382C3711-E222-4173-BF8A-81EBD7E3508A@.microsoft.com...
> Hello!
> My problem is:
> In Sql Server I made a table "Nir" with 3 columns:
> Nr_crt - numeric
> Val_TVA - numeric
> Val_Tot - numeric
>
> In SQL Server the command:
> SELECT SUM(Val_TVA) AS Val_TVA, SUM(Val_Tot) AS Val_Tot FROM Nir -
> returned
> me a result with 2 sums... OK!
>
> My question is:
> In Visual C++ - MFC I don't know how can to execute this command and to
> get
> the result return by this comand (may be with a VARIANT - pvRecord I don't
> know)
> How to access the result return by this command''
> I use CDatabase and CRecordset.
>
> Thank You very much!
>
>
ODBC - SQL Server 200 - MFC - Visual C++.NET (2003)
My problem is:
In Sql Server I made a table "Nir" with 3 columns:
Nr_crt - numeric
Val_TVA - numeric
Val_Tot - numeric
In SQL Server the command:
SELECT SUM(Val_TVA) AS Val_TVA, SUM(Val_Tot) AS Val_Tot FROM Nir - returned
me a result with 2 sums... OK!
My question is:
In Visual C++ - MFC I don't know how can to execute this command and to get
the result return by this comand (may be with a VARIANT - pvRecord I don't
know)
How to access the result return by this command??
I use CDatabase and CRecordset.
Thank You very much!
Create a CRecordset, then execute the SQL statement on it. Then you have
can use GetFieldValue on the recordset grab the results in CDBVariants.
"Florin" <Florin@.discussions.microsoft.com> wrote in message
news:382C3711-E222-4173-BF8A-81EBD7E3508A@.microsoft.com...
> Hello!
> My problem is:
> In Sql Server I made a table "Nir" with 3 columns:
> Nr_crt - numeric
> Val_TVA - numeric
> Val_Tot - numeric
>
> In SQL Server the command:
> SELECT SUM(Val_TVA) AS Val_TVA, SUM(Val_Tot) AS Val_Tot FROM Nir -
> returned
> me a result with 2 sums... OK!
>
> My question is:
> In Visual C++ - MFC I don't know how can to execute this command and to
> get
> the result return by this comand (may be with a VARIANT - pvRecord I don't
> know)
> How to access the result return by this command??
> I use CDatabase and CRecordset.
>
> Thank You very much!
>
>
Wednesday, March 7, 2012
Obtaining SQL RSS Developer Addition
Pro, SQL 2000 Dev. Edition, and Visual Studio .NET 2003.
Where can I download or obtain the install file for SQL Reporting Services
Developer Edition?
- MaxI tried the same question a while ago with no reply out here.
No I bought msdn pro subscription to get visual studio and here I can
download rep s dev. edition as well.
You should think that you could get it for free if you have sql 2000 dev
edition, though...
"Max Tyack" <MaxTyack@.discussions.microsoft.com> wrote in message
news:89C903A1-E927-4F26-93B0-6D8C63CEFDF5@.microsoft.com...
> I want to install SQL Reporting Services on my laptop which has Windows XP
> Pro, SQL 2000 Dev. Edition, and Visual Studio .NET 2003.
> Where can I download or obtain the install file for SQL Reporting Services
> Developer Edition?
> - Max|||What are you trying to achieve Max?, the Reporting Services server-part does
not run on MSDE you can't install the reports-database on MSDE and it also
needs IIS to host the reports website.
Ed
"Max Tyack" <MaxTyack@.discussions.microsoft.com> wrote in message
news:89C903A1-E927-4F26-93B0-6D8C63CEFDF5@.microsoft.com...
>I want to install SQL Reporting Services on my laptop which has Windows XP
> Pro, SQL 2000 Dev. Edition, and Visual Studio .NET 2003.
> Where can I download or obtain the install file for SQL Reporting Services
> Developer Edition?
> - Max|||But you have different versions of rep s as welle as different versions of
sql server:
developers ediition
standard edition
entreprise edition
dev ed is much cheaper and can be used for dev purposes.
"Ed Richard" <Ed_XXX_@.wss-ed_REMOVE_.nl> wrote in message
news:%23mIKQ8tgFHA.3788@.tk2msftngp13.phx.gbl...
> What are you trying to achieve Max?, the Reporting Services server-part
does
> not run on MSDE you can't install the reports-database on MSDE and it also
> needs IIS to host the reports website.
> Ed
> "Max Tyack" <MaxTyack@.discussions.microsoft.com> wrote in message
> news:89C903A1-E927-4F26-93B0-6D8C63CEFDF5@.microsoft.com...
> >I want to install SQL Reporting Services on my laptop which has Windows
XP
> > Pro, SQL 2000 Dev. Edition, and Visual Studio .NET 2003.
> >
> > Where can I download or obtain the install file for SQL Reporting
Services
> > Developer Edition?
> >
> > - Max
>|||I got lucky and found someone who had the setup file for SQL RSS Dev.
Edition. I am using it on SQL Dev Edition, not SQL MSDE (Desktop Edition).
And running iis on WinXP as well. All are working fine on my XP machine now.
"Michael Vardinghus" wrote:
> But you have different versions of rep s as welle as different versions of
> sql server:
> developers ediition
> standard edition
> entreprise edition
> dev ed is much cheaper and can be used for dev purposes.
> "Ed Richard" <Ed_XXX_@.wss-ed_REMOVE_.nl> wrote in message
> news:%23mIKQ8tgFHA.3788@.tk2msftngp13.phx.gbl...
> > What are you trying to achieve Max?, the Reporting Services server-part
> does
> > not run on MSDE you can't install the reports-database on MSDE and it also
> > needs IIS to host the reports website.
> >
> > Ed
> >
> > "Max Tyack" <MaxTyack@.discussions.microsoft.com> wrote in message
> > news:89C903A1-E927-4F26-93B0-6D8C63CEFDF5@.microsoft.com...
> > >I want to install SQL Reporting Services on my laptop which has Windows
> XP
> > > Pro, SQL 2000 Dev. Edition, and Visual Studio .NET 2003.
> > >
> > > Where can I download or obtain the install file for SQL Reporting
> Services
> > > Developer Edition?
> > >
> > > - Max
> >
> >
>
>|||You can order a CD here:
http://www.microsoft.com/sql/reporting/howtobuy/retailfulfillment.mspx
Ed
"Max Tyack" <MaxTyack@.discussions.microsoft.com> wrote in message
news:89C903A1-E927-4F26-93B0-6D8C63CEFDF5@.microsoft.com...
>I want to install SQL Reporting Services on my laptop which has Windows XP
> Pro, SQL 2000 Dev. Edition, and Visual Studio .NET 2003.
> Where can I download or obtain the install file for SQL Reporting Services
> Developer Edition?
> - Max|||Hi,
This discussion is probably closed, but maybe you can still help me.
Could anyone ever find a link to download the Reporting Services Developer
Edition?
I have Reporting Services Evaluation Edition on my XP machine, but I wonder
what will happen when the 120 day trial duration expires and therefore wanna
install the developer edition.
Thanks,
Gul
"Ed Richard" wrote:
> You can order a CD here:
> http://www.microsoft.com/sql/reporting/howtobuy/retailfulfillment.mspx
> Ed
> "Max Tyack" <MaxTyack@.discussions.microsoft.com> wrote in message
> news:89C903A1-E927-4F26-93B0-6D8C63CEFDF5@.microsoft.com...
> >I want to install SQL Reporting Services on my laptop which has Windows XP
> > Pro, SQL 2000 Dev. Edition, and Visual Studio .NET 2003.
> >
> > Where can I download or obtain the install file for SQL Reporting Services
> > Developer Edition?
> >
> > - Max
>
>
Obtaining RS developer edition?
Developer Edition of SQL Server. However, there was no CD of Reporting
Services contained in the box, and I can't find it anywhere for download.
Where can I get it?
Thanks.
Jon Pearce
jonp at the domain below
dgapartners.dropthispart.comJon Pearce wrote:
> We just purchased the Visual Studio .NET Special Edition, which includes the
> Developer Edition of SQL Server. However, there was no CD of Reporting
> Services contained in the box, and I can't find it anywhere for download.
> Where can I get it?
http://www.microsoft.com/sql/reporting/howtobuy/default.asp
U.S. and Canadian retail customers can order the CD directly via the
website. ($5 U.S.)
-BA|||UK customers can get it from a MS reseller (e.g.
http://www.greymatter.co.uk)
Note that it is more expensive to order the media kit outside of North
Amaerica - though still not a bad price (Sterling £ 27). I see no reason
for the huge discrepancy though, especially as it's just a CD, not even
boxed!
"Jon Pearce" <jpearce@.noemail.com> wrote in message
news:eTv%23guJsEHA.3048@.tk2msftngp13.phx.gbl...
> We just purchased the Visual Studio .NET Special Edition, which includes
> the
> Developer Edition of SQL Server. However, there was no CD of Reporting
> Services contained in the box, and I can't find it anywhere for download.
> Where can I get it?
> Thanks.
> Jon Pearce
> jonp at the domain below
> dgapartners.dropthispart.com
>
Monday, February 20, 2012
ObjRecordSet somehow not populating in ActiveX Script
' Visual Basic ActiveX Script
'************************************************* ***********************
Option Explicit
Function Main()
Dim objConnection
Dim objRecordSet
Dim strTotal
Dim strPathtoTextFile
DTSGlobalVariables("sSub").Value = "Errors: = "
strtotal = strtotal & DTSGlobalVariables("sSub").Value & "0"
On Error Resume Next
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
strPathtoTextFile = "M:\Rep\AA\"
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathtoTextFile & ";" & _
"Extended Properties=""text;HDR=NO;FMT=Delimited"""
objRecordset.Open "SELECT * FROM svcmont.txt", _
objConnection, adOpenStatic, adLockOptimistic, adCmdText
Do Until objRecordset.EOF
Wscript.Echo "Ty: " & objRecordset.Fields.Item("Ty")
Wscript.Echo "Va: " & objRecordset.Fields.Item("Va")
objRecordset.MoveNext
Loop
DTSGlobalVariables("sSub").Value = DTSGlobalVariables("sSub").Value &
objRecordset.Fields.Item("Va")
If strtotal <> DTSGlobalVariables("sSub").Value Then
Main = DTSTaskExecResult_Success
Else
Main = DTSTaskExecResult_Failure
End If
End Function
'************************************************* ***********************
Sample of input file:
Q, 0
QC, 0
Q, 0
Q, 0
Q, 0
QC, 0
Is this a replication script? I think you should repost this in the DTS
group.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Swim" <crombusch@.gmail.com> wrote in message
news:1138049022.892789.174050@.g43g2000cwa.googlegr oups.com...
> '************************************************* ***********************
> ' Visual Basic ActiveX Script
> '************************************************* ***********************
> Option Explicit
> Function Main()
> Dim objConnection
> Dim objRecordSet
> Dim strTotal
> Dim strPathtoTextFile
> DTSGlobalVariables("sSub").Value = "Errors: = "
> strtotal = strtotal & DTSGlobalVariables("sSub").Value & "0"
> On Error Resume Next
> Const adOpenStatic = 3
> Const adLockOptimistic = 3
> Const adCmdText = &H0001
> Set objConnection = CreateObject("ADODB.Connection")
> Set objRecordSet = CreateObject("ADODB.Recordset")
> strPathtoTextFile = "M:\Rep\AA\"
> objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Data Source=" & strPathtoTextFile & ";" & _
> "Extended Properties=""text;HDR=NO;FMT=Delimited"""
> objRecordset.Open "SELECT * FROM svcmont.txt", _
> objConnection, adOpenStatic, adLockOptimistic, adCmdText
> Do Until objRecordset.EOF
> Wscript.Echo "Ty: " & objRecordset.Fields.Item("Ty")
> Wscript.Echo "Va: " & objRecordset.Fields.Item("Va")
> objRecordset.MoveNext
> Loop
> DTSGlobalVariables("sSub").Value = DTSGlobalVariables("sSub").Value &
> objRecordset.Fields.Item("Va")
> If strtotal <> DTSGlobalVariables("sSub").Value Then
> Main = DTSTaskExecResult_Success
> Else
> Main = DTSTaskExecResult_Failure
> End If
> End Function
> '************************************************* ***********************
> Sample of input file:
> --
> Q, 0
> QC, 0
> Q, 0
> Q, 0
> Q, 0
> QC, 0
>