Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Wednesday, March 21, 2012

Creating a shared ODBC dsn for Access to SQL Server connection

I have a Microsoft Access application which uses linked SQL Server tables. I would like to create an ODBC DSN which would be available to all users so that I don't have to create a DSN on each machine. Can this be done? The Access application resides on a shared drive (Windows). Thanks for your help.

Don,

Will a File DSN work for what you are trying to do? I don't have much experience with those, so I can't help you more in that area.

I too had a similar problem as you do, and I didn't want to go through manually creating a DSN on everybody's machine. I found this script that will make your life slightly easier:

http://www.enterpriseitplanet.com/resources/scripts_win/article.php/3089341

With a little modification to the example included in that web page, I had all my users that needed a DSN ready to rock within a mouse-click!

Thanks,

Chuck

|||Thanks, Chuck. The script will certainly make the process easier if there isn't a way to create a global ODBC DSN. Appreciate the help.

Monday, March 19, 2012

Creating a Package of dtsx packages

Hi

I am trying to build a package that is comprised of 100+ dtsx packages but cannot seem to get it to work. I have created a new connection where the connectionmanagertype = file and the file path is equal to the folder in which my dtsx files are located. I (location = fileSystem). No matter what I do I get an access denied error that shows the folder location but no package. I manually typed the name of the package in the PackageName property and have pasted in the PackageID in the appropriate property as well but I don't see anything in the PackageNameReadOnly. I have read the MSDN information but I don't see a step by step way to build a package of packages against which I can compare. Can anyone set me straight?

Thanks.

Robin

You can't point a connection to a folder; it has to point to a package (.dtsx file).|||

Hi Cheese,

You can use Execute Package Tasks to do the trick. Here's how I build these:

1. Create a new SSIS package.

2. On the Control Flow, drag an Execute Package Task from the toolbox.

3. Double-click it to open the editor.

4. On the General page, give it a descriptive name.

5. On the Package page, click the COnnection dropdown and select <New Connection...>

6. Select Existing File for Usage Type and navigate to the file.

7. If the package is password protected, click the ellipsis (sp?) in the Password textbox and enter it (and confirm).

8. Click OK to exit the editor.

That should be enough to run a package.

Hope this helps,

Andy

|||Yep, I assumed Robin was trying to use the Execute Package tasks... If not, then Andy is spot on.|||

Hi

What I was actually trying to do was execute 115 packages (children) from a single package (parent) where I only used one connection manager. I thought that if I use the existing folder option I shouldn't have to create a connection manager for each one. I can do this writing code in an execute process task and the .net framework but that was more effort (troubleshooting properties) than it was worth. To me it would seem that I should be able to define a directory and recursively execute each *.dtsx package in a looping fashion in a simpler fashion. So far the only way I have gotten this to work is to 115 excecute package tasks with 115 connection managers (1 to 1 relationship of course) and then execute each one upon completion and out of process. This while successful seems to be a very poor way of doing things.

Thanks,

Robin

|||

Do you need to execute those packages serially or in parallel? If you need them to run in a serial fashion; you may use a ForEach loop container and 1 execute package task/Connection manager.

But if you need them to run in parallel or if you need to create precedence constraint between packages; I don't see a better way than having 115 execute package tasks and connection managers.

Notice that is you use Execute system task; the task will return succesfull right after sending the command; so the master package will not know whether the called package fail or not.

|||

My goal is/was to execute them sequentially and independent of the status of the previous step. Each dtsx I believe shouldn't require its own connection (at least in my mind) since they all reside in the same directory folder. I just wanted to iterate through a folder running all dtsx packages in the simplest manner possible. My solution right now is to have a connection manager for each source file (all 115 of them). This seems to be a really stupid thing to do.

Thanks,

Robin

|||

Cheese Bread wrote:

My goal is/was to execute them sequentially and independent of the status of the previous step. Each dtsx I believe shouldn't require its own connection (at least in my mind) since they all reside in the same directory folder. I just wanted to iterate through a folder running all dtsx packages in the simplest manner possible.

This sounds like the best approach for your scenario and is what I would have done. Why didn't it work?

-Jamie

|||

My theory always failed because if I configured the connection to the folder level, it never found the individual dtsx files. I always got an error basically telling me it couldn't find the package. If you create a connection at the file level for each dtsx using the interface (and not creating a loop in .Net code) you get a direct connection to the file itself and the settings are created for you. This will run fine. If you just define the folder through the interface there is no defined dtsx file (which is good) but it always errors. It is as if the folder connection is for output only. To recreate the problem on your machine create two simple dtsx packages and store them in the file system. Then create a new package and try to run the two previously created ones. If you create two connections you are fine but if you create one connection set to the folder it will fail.

Thanks,

Robin

|||

Cheese Bread wrote:

My theory always failed because if I configured the connection to the folder level, it never found the individual dtsx files. I always got an error basically telling me it couldn't find the package. If you create a connection at the file level for each dtsx using the interface (and not creating a loop in .Net code) you get a direct connection to the file itself and the settings are created for you. This will run fine. If you just define the folder through the interface there is no defined dtsx file (which is good) but it always errors. It is as if the folder connection is for output only. To recreate the problem on your machine create two simple dtsx packages and store them in the file system. Then create a new package and try to run the two previously created ones. If you create two connections you are fine but if you create one connection set to the folder it will fail.

Thanks,

Robin

Use a foreach loop to spin through your specific folder looking for *.dtsx files. Then, inside that foreach loop, you have one execute package task. Using the expressions feature of that task, you can set the Connection property to the variable populated by the foreach loop.

Creating a Package of dtsx packages

Hi

I am trying to build a package that is comprised of 100+ dtsx packages but cannot seem to get it to work. I have created a new connection where the connectionmanagertype = file and the file path is equal to the folder in which my dtsx files are located. I (location = fileSystem). No matter what I do I get an access denied error that shows the folder location but no package. I manually typed the name of the package in the PackageName property and have pasted in the PackageID in the appropriate property as well but I don't see anything in the PackageNameReadOnly. I have read the MSDN information but I don't see a step by step way to build a package of packages against which I can compare. Can anyone set me straight?

Thanks.

Robin

You can't point a connection to a folder; it has to point to a package (.dtsx file).|||

Hi Cheese,

You can use Execute Package Tasks to do the trick. Here's how I build these:

1. Create a new SSIS package.

2. On the Control Flow, drag an Execute Package Task from the toolbox.

3. Double-click it to open the editor.

4. On the General page, give it a descriptive name.

5. On the Package page, click the COnnection dropdown and select <New Connection...>

6. Select Existing File for Usage Type and navigate to the file.

7. If the package is password protected, click the ellipsis (sp?) in the Password textbox and enter it (and confirm).

8. Click OK to exit the editor.

That should be enough to run a package.

Hope this helps,

Andy

|||Yep, I assumed Robin was trying to use the Execute Package tasks... If not, then Andy is spot on.|||

Hi

What I was actually trying to do was execute 115 packages (children) from a single package (parent) where I only used one connection manager. I thought that if I use the existing folder option I shouldn't have to create a connection manager for each one. I can do this writing code in an execute process task and the .net framework but that was more effort (troubleshooting properties) than it was worth. To me it would seem that I should be able to define a directory and recursively execute each *.dtsx package in a looping fashion in a simpler fashion. So far the only way I have gotten this to work is to 115 excecute package tasks with 115 connection managers (1 to 1 relationship of course) and then execute each one upon completion and out of process. This while successful seems to be a very poor way of doing things.

Thanks,

Robin

|||

Do you need to execute those packages serially or in parallel? If you need them to run in a serial fashion; you may use a ForEach loop container and 1 execute package task/Connection manager.

But if you need them to run in parallel or if you need to create precedence constraint between packages; I don't see a better way than having 115 execute package tasks and connection managers.

Notice that is you use Execute system task; the task will return succesfull right after sending the command; so the master package will not know whether the called package fail or not.

|||

My goal is/was to execute them sequentially and independent of the status of the previous step. Each dtsx I believe shouldn't require its own connection (at least in my mind) since they all reside in the same directory folder. I just wanted to iterate through a folder running all dtsx packages in the simplest manner possible. My solution right now is to have a connection manager for each source file (all 115 of them). This seems to be a really stupid thing to do.

Thanks,

Robin

|||

Cheese Bread wrote:

My goal is/was to execute them sequentially and independent of the status of the previous step. Each dtsx I believe shouldn't require its own connection (at least in my mind) since they all reside in the same directory folder. I just wanted to iterate through a folder running all dtsx packages in the simplest manner possible.

This sounds like the best approach for your scenario and is what I would have done. Why didn't it work?

-Jamie

|||

My theory always failed because if I configured the connection to the folder level, it never found the individual dtsx files. I always got an error basically telling me it couldn't find the package. If you create a connection at the file level for each dtsx using the interface (and not creating a loop in .Net code) you get a direct connection to the file itself and the settings are created for you. This will run fine. If you just define the folder through the interface there is no defined dtsx file (which is good) but it always errors. It is as if the folder connection is for output only. To recreate the problem on your machine create two simple dtsx packages and store them in the file system. Then create a new package and try to run the two previously created ones. If you create two connections you are fine but if you create one connection set to the folder it will fail.

Thanks,

Robin

|||

Cheese Bread wrote:

My theory always failed because if I configured the connection to the folder level, it never found the individual dtsx files. I always got an error basically telling me it couldn't find the package. If you create a connection at the file level for each dtsx using the interface (and not creating a loop in .Net code) you get a direct connection to the file itself and the settings are created for you. This will run fine. If you just define the folder through the interface there is no defined dtsx file (which is good) but it always errors. It is as if the folder connection is for output only. To recreate the problem on your machine create two simple dtsx packages and store them in the file system. Then create a new package and try to run the two previously created ones. If you create two connections you are fine but if you create one connection set to the folder it will fail.

Thanks,

Robin

Use a foreach loop to spin through your specific folder looking for *.dtsx files. Then, inside that foreach loop, you have one execute package task. Using the expressions feature of that task, you can set the Connection property to the variable populated by the foreach loop.

Sunday, March 11, 2012

Creating a Package of dtsx packages

Hi

I am trying to build a package that is comprised of 100+ dtsx packages but cannot seem to get it to work. I have created a new connection where the connectionmanagertype = file and the file path is equal to the folder in which my dtsx files are located. I (location = fileSystem). No matter what I do I get an access denied error that shows the folder location but no package. I manually typed the name of the package in the PackageName property and have pasted in the PackageID in the appropriate property as well but I don't see anything in the PackageNameReadOnly. I have read the MSDN information but I don't see a step by step way to build a package of packages against which I can compare. Can anyone set me straight?

Thanks.

Robin

You can't point a connection to a folder; it has to point to a package (.dtsx file).|||

Hi Cheese,

You can use Execute Package Tasks to do the trick. Here's how I build these:

1. Create a new SSIS package.

2. On the Control Flow, drag an Execute Package Task from the toolbox.

3. Double-click it to open the editor.

4. On the General page, give it a descriptive name.

5. On the Package page, click the COnnection dropdown and select <New Connection...>

6. Select Existing File for Usage Type and navigate to the file.

7. If the package is password protected, click the ellipsis (sp?) in the Password textbox and enter it (and confirm).

8. Click OK to exit the editor.

That should be enough to run a package.

Hope this helps,

Andy

|||Yep, I assumed Robin was trying to use the Execute Package tasks... If not, then Andy is spot on.|||

Hi

What I was actually trying to do was execute 115 packages (children) from a single package (parent) where I only used one connection manager. I thought that if I use the existing folder option I shouldn't have to create a connection manager for each one. I can do this writing code in an execute process task and the .net framework but that was more effort (troubleshooting properties) than it was worth. To me it would seem that I should be able to define a directory and recursively execute each *.dtsx package in a looping fashion in a simpler fashion. So far the only way I have gotten this to work is to 115 excecute package tasks with 115 connection managers (1 to 1 relationship of course) and then execute each one upon completion and out of process. This while successful seems to be a very poor way of doing things.

Thanks,

Robin

|||

Do you need to execute those packages serially or in parallel? If you need them to run in a serial fashion; you may use a ForEach loop container and 1 execute package task/Connection manager.

But if you need them to run in parallel or if you need to create precedence constraint between packages; I don't see a better way than having 115 execute package tasks and connection managers.

Notice that is you use Execute system task; the task will return succesfull right after sending the command; so the master package will not know whether the called package fail or not.

|||

My goal is/was to execute them sequentially and independent of the status of the previous step. Each dtsx I believe shouldn't require its own connection (at least in my mind) since they all reside in the same directory folder. I just wanted to iterate through a folder running all dtsx packages in the simplest manner possible. My solution right now is to have a connection manager for each source file (all 115 of them). This seems to be a really stupid thing to do.

Thanks,

Robin

|||

Cheese Bread wrote:

My goal is/was to execute them sequentially and independent of the status of the previous step. Each dtsx I believe shouldn't require its own connection (at least in my mind) since they all reside in the same directory folder. I just wanted to iterate through a folder running all dtsx packages in the simplest manner possible.

This sounds like the best approach for your scenario and is what I would have done. Why didn't it work?

-Jamie

|||

My theory always failed because if I configured the connection to the folder level, it never found the individual dtsx files. I always got an error basically telling me it couldn't find the package. If you create a connection at the file level for each dtsx using the interface (and not creating a loop in .Net code) you get a direct connection to the file itself and the settings are created for you. This will run fine. If you just define the folder through the interface there is no defined dtsx file (which is good) but it always errors. It is as if the folder connection is for output only. To recreate the problem on your machine create two simple dtsx packages and store them in the file system. Then create a new package and try to run the two previously created ones. If you create two connections you are fine but if you create one connection set to the folder it will fail.

Thanks,

Robin

|||

Cheese Bread wrote:

My theory always failed because if I configured the connection to the folder level, it never found the individual dtsx files. I always got an error basically telling me it couldn't find the package. If you create a connection at the file level for each dtsx using the interface (and not creating a loop in .Net code) you get a direct connection to the file itself and the settings are created for you. This will run fine. If you just define the folder through the interface there is no defined dtsx file (which is good) but it always errors. It is as if the folder connection is for output only. To recreate the problem on your machine create two simple dtsx packages and store them in the file system. Then create a new package and try to run the two previously created ones. If you create two connections you are fine but if you create one connection set to the folder it will fail.

Thanks,

Robin

Use a foreach loop to spin through your specific folder looking for *.dtsx files. Then, inside that foreach loop, you have one execute package task. Using the expressions feature of that task, you can set the Connection property to the variable populated by the foreach loop.

Creating a new connection with Microsoft SQL Server 2005 Compact Edition from Visual Studio 2005

Hello, How are you?
I have a problem when I try to create a new connection with Microsoft SQL Server 2005 Compact Edition from Visual Studio 2005 IDE. When I’m going to choose the data source, the SQL Server 2005 Compact Edition provider doesn’t appear in the list. I installed the SQL Server 2005 Compact Edition from this page http://www.microsoft.com/downloads/details.aspx?FamilyId=%2085E0C3CE-3FA1-453A-8CE9-AF6CA20946C3&displaylang=en. In the additional information says by installing SQLServerCE31-EN.msi installs the provider (System.Data.SqlServerCe.dll) in the GAC (global assembly cache) and registers the OLEDB provider (sqlceoledb30.dll). So, I don’t understand why couldn’t I create a new connection with Microsoft SQL Server 2005 Compact Edition from Visual Studio 2005 IDE?

I appreciate your help…

I believe you need to be on Visual Studio 2005 SP 1 for the Data Source name to show up as 'Microsoft SQL Server 2005 Compact Edition' in the Change Data Source dialog in Visual Studio. I just checked and mine does show the new provider. My guess is that if you aren't on SP1, you'll see SQL Mobile in the list but the provider that gets referenced in your project will be the updated provider.

Darren

|||

I had the exact same problem and wanted to share the solution with you.

1) Uninstall SQL Server 2005 Compact Edition (SSCE)

2) Uninstall SSCE SDK

3) Uninsall SSCE SP1 Tools

4) Run setup from your Visual Studio 2005 CD

5) Click Change or remove

6) Add or Remove Features

7) Uncheck Smart Device Programability

8) Click Update

9) Repeat steps 4-8 except this time Check Smart Device Programability

10) Install SQL Server 2005 Compact Edition (SSCE)

11) Install SSCE SDK

12) Install SSCE SP1 Tools

It should now work. This is the only way I could get it to show up. I hope this helps.

|||

Took me a long time to find this post, your solution solved my problem. I did not have to do steps 4-8 twice. The first time I went to Add or Remove Features the Smart Device programability was not checked, so I checked it and clicked update. After update was complete I installed the SQL Server 2005 Compact Edition (SSCE) and it now appears as a choice for a Data Source when adding a new connection.

Thanks!!!!!!!!!!!!!!!!

|||

Yes!!! It worked out for me too. Thanks a lot dear Winblazer! I spent a day fighting with Microsft, I mean this issue. I am wondering if Bill Gates ever tried to install any of MS development tool and create an application just to display "Hello World!". Just for fun. I am sure he would have a lot of fun.

Thank again.

Thursday, March 8, 2012

Creating a Linked Server to AS400 in SQL Server 2005

I am trying to create a linked server in SQL Server 2005 to show tables in our AS400. I made the connection, however, the tables are not showing up under the Linked Server name.

How do you get the linked tables to display in the Linked Server folder?

David

Are you sure you did provide the right catalog ? If you don't have access rights to the catalog or to specific objcts you also won't see them in the list. Make sure that the user associated with the linked server has the appropiate rights to see the objects.

HTH, Jens Suessmeyer.

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

I am trying almost the same thing. But I am not even able to create the connection to the server.

I tried it like this:

Provider: Microsoft OLE DB Provider for ODBC Driver

Product name: IBMDASQL ?

Data source: MyAS400

Catalog: MyCatalog

And I create a local login.

When I try to access the database with a query I get the error: can not start the connection. Do you know what is wrong with my Link Server

|||

I downloaded a new driver from the Microsoft website: Microsoft OLEDB Provider for DB2

I had better success with this:

When setting up the connection, I used the following settings:

Settings:

Data Source (Enter IP address of AS/400)

NetworkTCP/IP Connect…. (Enter IP address of AS/400)

Single sign on is unchecked

Username

Pw

Initial Catalog : AS/400 System name (from the sign on screen)

Package: QSYS

Default Schema: (Enter name of Library where data is located )

Advanced Tab: DB2/400

Hope this helps.

David

Creating a Linked Server to AS400 in SQL Server 2005

I am trying to create a linked server in SQL Server 2005 to show tables in our AS400. I made the connection, however, the tables are not showing up under the Linked Server name.

How do you get the linked tables to display in the Linked Server folder?

David

Are you sure you did provide the right catalog ? If you don't have access rights to the catalog or to specific objcts you also won't see them in the list. Make sure that the user associated with the linked server has the appropiate rights to see the objects.

HTH, Jens Suessmeyer.

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

I am trying almost the same thing. But I am not even able to create the connection to the server.

I tried it like this:

Provider: Microsoft OLE DB Provider for ODBC Driver

Product name: IBMDASQL ?

Data source: MyAS400

Catalog: MyCatalog

And I create a local login.

When I try to access the database with a query I get the error: can not start the connection. Do you know what is wrong with my Link Server

|||

I downloaded a new driver from the Microsoft website: Microsoft OLEDB Provider for DB2

I had better success with this:

When setting up the connection, I used the following settings:

Settings:

Data Source (Enter IP address of AS/400)

NetworkTCP/IP Connect…. (Enter IP address of AS/400)

Single sign on is unchecked

Username

Pw

Initial Catalog : AS/400 System name (from the sign on screen)

Package: QSYS

Default Schema: (Enter name of Library where data is located )

Advanced Tab: DB2/400

Hope this helps.

David

Saturday, February 25, 2012

Creating a Custom Connection Manager Sample

http://msdn2.microsoft.com/en-us/library/ms345276.aspx

does anyone know where this can be obtained? it did not come with the RTM. it does not seem to be available via download either?

a little help here!

If you will provide an email address, I can email you this sample and a 2nd custom connection manager sample that will be included in the next refresh of BOL, scheduled to coincide with SP1.

-Doug

|||

andy.d.loechler@.wellsfargo.com

thanks

|||Can I get it too. (cipracunari at sezampro dot yu)
|||

As Books Online has been updated, we also have some updated samples to match-

Download details: SQL Server 2005 Samples and Sample Databases (April 2006)
(http://www.microsoft.com/downloads/details.aspx?FamilyID=e719ecf7-9f46-4312-af89-6ad8702e4e6e&DisplayLang=en)

It is in the SqlServerSamples.msi.

Creating a Custom Connection Manager Sample

http://msdn2.microsoft.com/en-us/library/ms345276.aspx

does anyone know where this can be obtained? it did not come with the RTM. it does not seem to be available via download either?

a little help here!

If you will provide an email address, I can email you this sample and a 2nd custom connection manager sample that will be included in the next refresh of BOL, scheduled to coincide with SP1.

-Doug

|||

andy.d.loechler@.wellsfargo.com

thanks

|||Can I get it too. (cipracunari at sezampro dot yu)|||

As Books Online has been updated, we also have some updated samples to match-

Download details: SQL Server 2005 Samples and Sample Databases (April 2006)
(http://www.microsoft.com/downloads/details.aspx?FamilyID=e719ecf7-9f46-4312-af89-6ad8702e4e6e&DisplayLang=en)

It is in the SqlServerSamples.msi.

Friday, February 24, 2012

creating a connection to DB2 from sql server

Can We Create a SQL Server connection to DB2 using linked servers?If yes, how can we do that.ANd one more thing is that my DB2 is on unix and sqlserver is on windows.
Thanks.This MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_12_1gvm.asp link will explain the scenario.

Creating a Connection to Database that Does Not Yet Exist

Hello All!
I am in the process of developing a DTS package. My
package will behave as follows:
1. Backup my live database.
2. Using the backup from Step 1., the backup will be
restored using a DIFFERENT name (NewDatabase).
3. Manipulate NewDatabase database.
How can I create a connection in my DTS Package when, at
the time I am creating the package, the NewDatabase
database does not exist? Do I have to use Disconnected
Edits? If so, how? Or, do I use Microsoft Data Link?
If so, how? Or, do I use something else. (As you can
tell from my questions, I am not an expert at this :-)
Any suggestions are greatly appreciated!!You should be able to connect to the master database to do what you need to
do initially.
Ray Higdon MCSE, MCDBA, CCNA
--
"ERR" <anonymous@.discussions.microsoft.com> wrote in message
news:ef7b01c3f1b0$3f8eff20$a301280a@.phx.gbl...
> Hello All!
> I am in the process of developing a DTS package. My
> package will behave as follows:
> 1. Backup my live database.
> 2. Using the backup from Step 1., the backup will be
> restored using a DIFFERENT name (NewDatabase).
> 3. Manipulate NewDatabase database.
> How can I create a connection in my DTS Package when, at
> the time I am creating the package, the NewDatabase
> database does not exist? Do I have to use Disconnected
> Edits? If so, how? Or, do I use Microsoft Data Link?
> If so, how? Or, do I use something else. (As you can
> tell from my questions, I am not an expert at this :-)
> Any suggestions are greatly appreciated!!|||I forgot to mention that I do have an initial connection,
the one to the original database. However, I need my DTS
package to create a connection to the NewDatabase
database once the task of restoring with a new name is
complete.
Thanks in advance!

>--Original Message--
>You should be able to connect to the master database to
do what you need to
>do initially.
>--
>Ray Higdon MCSE, MCDBA, CCNA
>--
>"ERR" <anonymous@.discussions.microsoft.com> wrote in
message
>news:ef7b01c3f1b0$3f8eff20$a301280a@.phx.gbl...
at
>
>.
>|||To do what? If it's only to run a sql script you can use workflow and
connect to the master database and then do the "use yournewdb" command after
you have created it
Ray Higdon MCSE, MCDBA, CCNA
--
"ERR" <anonymous@.discussions.microsoft.com> wrote in message
news:f43101c3f22e$9ff978d0$a301280a@.phx.gbl...
> I forgot to mention that I do have an initial connection,
> the one to the original database. However, I need my DTS
> package to create a connection to the NewDatabase
> database once the task of restoring with a new name is
> complete.
> Thanks in advance!
>
> do what you need to
> message
> at|||what you need to do as per Ray's suggestion is to create the dts package and
set it to connect to master, then create a dynamic task properties and a
global variable <dbname> to change the value of catalog property in
Disconnect Edit DE at run time.
then when you execute the dts package need to execute with the /A switch to
pass the <db> variable which u proide at run time see example below
dtsrun /S <servername> /E /N<packagename> /A <db>:8=newdatabase
this way u can connect to a database at runtime.
--
Olu Adedeji
"Ray Higdon" <sqlhigdon@.nospam.yahoo.com> wrote in message
news:eR5zJ8y8DHA.3880@.tk2msftngp13.phx.gbl...
> To do what? If it's only to run a sql script you can use workflow and
> connect to the master database and then do the "use yournewdb" command
after
> you have created it
> --
> Ray Higdon MCSE, MCDBA, CCNA
> --
> "ERR" <anonymous@.discussions.microsoft.com> wrote in message
> news:f43101c3f22e$9ff978d0$a301280a@.phx.gbl...
>

Creating a Connection

I am trying to connect to a database on an MS Sql server, I typed the code exactly like what is shown in the tutorial and I keep getting an error... (Error in line 6)

Line 4: Dim oODBCConnection As OdbcConnection
Line 5: Dim sConnString As String = _
Line 6: "Driver={SQL Server};" &_
Line 7: "Server=209.151.130.8;" &_
Line 8: "Database=blah;" &_
...(Error in line 6)

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30203: Identifier expected.First off - I'd say you're going in the wrong direction, since it looks as if you're trying to connect with a SQL server - -
ASP.Net has a namespace that talks directly to SQL Server...
it should look more like the info in :
Database Connect and Display Samples

Which tutorial are you reading?|||I've been using Classic ASP untill now, I'm moving on up to .NET...

I'm looking for a very simple way to retreave some data from a database and display it using of of the data web controls..

The part that I'm having trouble with is comunicating with the server (creating a connection)..

On The Side:
I've read about placing the connection string in the AppSettings section in web.config, but this isn't going to work in my case because I am only working with a single aspx file... Am I correct in saying that this way won't work because I'm using only one aspx file..|||Ps: I changed the ip, and user name for security reasons...

<% @.Import Namespace="System.Data.SqlClient" %>
<% @.Import Namespace="System.Data" %>
<script language="vb" runat="server" debug="true"
Sub Page_Load(Source as Object, E as EventArgs)
Dim strConn as string = "server=555.555.11.11;uid=test;pwd=test1;database=webland"
Dim MySQL as string = "Select pl_username From Users"
Dim MyConn as New SQLConnection(strConn)
Dim ds as DataSet=New DataSet()
Dim Cmd as New SQLDataAdapter(MySQL,MyConn)
Cmd.Fill(ds,"Customers")
myDataList.Datasource=ds.Tables("users").DefaultView
myDataList.DataBind()
End Sub

</script
<asp:DataList runat="server" id="myDataList"
Width="85%" Border="1"
HorizontalAlign="Center"
Font-Name="Verdana" CellPadding="4"
Font-Size="10pt"
RepeatColumns="5" >
<ItemTemplate>
Question:<br />
<%# DataBinder.Eval(Container.DataItem, "pl_username") %>
</ItemTemplate>
</asp:DataList
ERROR:
Cannot open database requested in login 'webland'. Login fails. Login failed for user 'test'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open database requested in login 'webland'. Login fails. Login failed for user 'test'.

BUT:
I bleave that my user name information that I provided is correct..I think taht something else is causing the error, but i'm not getting the correct error message?|||It is very possible that wherever this database resides, that they are not using the standard sql port 1433. A lot of places are doing this now for security by obscurity reasons. Anyway, if you don't know for sure, I would contact the people who host your website and make sure that you have the right port. If it is a different port just add a comma and the port number after the server address. For example if you find out that the port number is 1435, then instead of this:

Dim strConn as string="server=555.555.11.11;uid=test;pwd=test1;database=webland"

try this:

Dim strConn as string="server=555.555.11.11,1435;uid=test;pwd=test1;database=webland"

Friday, February 17, 2012

CreateFile() Error

I am using SQL 7.0 to establish connection with my ISP SQL ,using the correct UserName/Password given by my ISP.However I encounter this error message and my ISP technical support say that no problem with the server.

Error Source:Microsoft OLE DB Provider for SQL Server

Error Description:Client unable to establish connection [DBNMPNTW]ConnectionOpen [CreateFile()]

Please help me with this.Go to you SQL Server Network Utility and change protocol type to TCP/IP.|||Thanks EdwardP.Problem solved!!!
But how about this error,?

[DBMSSOCN] General netwprk error?

Umm ,is it cause by my computer setting that do not join the domain?

CreateFile() Error

I am using SQL 7.0 to establish connection with my ISP SQL ,using the correct UserName/Password given by my ISP.However I encounter this error message and my ISP technical support say that no problem with the server.

Error Source:Microsoft OLE DB Provider for SQL Server

Error Description:Client unable to establish connection [DBNMPNTW]ConnectionOpen [CreateFile()]

Please help me with this.

*Note* connect through internetWhen you say you are using sql server 7 to connect - are you using enterprise manager or query analyzer ? If so, have you tried both.|||I am using enterprise manager ,DTS import wizard.|||Are you saying you can connect to enterprise manager but when you use the dts import wizard you receive this error ? Is the sql server running where on the isp side - and this sql server is version 7 ? If you can connect to enterprise manager ok, can you access tables ... ?