473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

System DSN

Hi,

I need to create a DB2 system DSN programmatically. I need to set the
currentschema parameter to be equal to the appropriate database name. I
am able to create the DSN ok, but am unable to add the currentschema
parameter. I am using visual fox pro 9. My code follows:

lc_driver = "IBM DB2 ODBC DRIVER" + CHR(0)

lc_dsn = "DESCRIPTION=Connection Description" + CHR(0)+ ;
DSN=TEST" + CHR(0)+ ;
"DBALIAS=" + ALLTRIM(UPPER(lc_DBAlias)) + CHR(0)+ ;
"CURRENTSCHEMA=" + ALLTRIM(UPPER(lcDatabase)) + CHR(0)+ ;
"UID=" + ALLTRIM(lc_AdminUser) + CHR(0)+ ;
"PWD=" + ALLTRIM(lc_AdminPassword) + CHR(0)

fResult = SQLConfigDataSource(0, 4, @lc_driver, @lc_dsn)

I don't get any error message and the DSN is created, but withou the
currentschema.
Any help would be appreciated.

Alan

Dec 15 '06 #1
7 5459

Al**********@gmail.com wrote:
Hi,

I need to create a DB2 system DSN programmatically. I need to set the
currentschema parameter to be equal to the appropriate database name. I
am able to create the DSN ok, but am unable to add the currentschema
parameter. I am using visual fox pro 9. My code follows:

lc_driver = "IBM DB2 ODBC DRIVER" + CHR(0)

lc_dsn = "DESCRIPTION=Connection Description" + CHR(0)+ ;
DSN=TEST" + CHR(0)+ ;
"DBALIAS=" + ALLTRIM(UPPER(lc_DBAlias)) + CHR(0)+ ;
"CURRENTSCHEMA=" + ALLTRIM(UPPER(lcDatabase)) + CHR(0)+ ;
"UID=" + ALLTRIM(lc_AdminUser) + CHR(0)+ ;
"PWD=" + ALLTRIM(lc_AdminPassword) + CHR(0)

fResult = SQLConfigDataSource(0, 4, @lc_driver, @lc_dsn)

I don't get any error message and the DSN is created, but withou the
currentschema.
Any help would be appreciated.

Alan
I don't know if you can set that parameter, hoipefully someone else
will respond. I'd just like to note that the SCHEMA can be SET after
the CONNECT by passing the statement: SET SCHEMA <schema>;.

B.

Dec 15 '06 #2
Al**********@gmail.com wrote:
Hi,

I need to create a DB2 system DSN programmatically. I need to set the
currentschema parameter to be equal to the appropriate database name. I
am able to create the DSN ok, but am unable to add the currentschema
parameter. I am using visual fox pro 9. My code follows:

lc_driver = "IBM DB2 ODBC DRIVER" + CHR(0)

lc_dsn = "DESCRIPTION=Connection Description" + CHR(0)+ ;
DSN=TEST" + CHR(0)+ ;
"DBALIAS=" + ALLTRIM(UPPER(lc_DBAlias)) + CHR(0)+ ;
"CURRENTSCHEMA=" + ALLTRIM(UPPER(lcDatabase)) + CHR(0)+ ;
"UID=" + ALLTRIM(lc_AdminUser) + CHR(0)+ ;
"PWD=" + ALLTRIM(lc_AdminPassword) + CHR(0)

fResult = SQLConfigDataSource(0, 4, @lc_driver, @lc_dsn)

I don't get any error message and the DSN is created, but withou the
currentschema.
Any help would be appreciated.

Alan
I don't know if you can set that parameter, hoipefully someone else
will respond. I'd just like to note that the SCHEMA can be SET after
the CONNECT by passing the statement: SET SCHEMA <schema>;.

B.

Dec 15 '06 #3
Al**********@gmail.com wrote:
Hi,

I need to create a DB2 system DSN programmatically. I need to set the
currentschema parameter to be equal to the appropriate database name. I
am able to create the DSN ok, but am unable to add the currentschema
parameter. I am using visual fox pro 9. My code follows:

lc_driver = "IBM DB2 ODBC DRIVER" + CHR(0)

lc_dsn = "DESCRIPTION=Connection Description" + CHR(0)+ ;
DSN=TEST" + CHR(0)+ ;
"DBALIAS=" + ALLTRIM(UPPER(lc_DBAlias)) + CHR(0)+ ;
"CURRENTSCHEMA=" + ALLTRIM(UPPER(lcDatabase)) + CHR(0)+ ;
"UID=" + ALLTRIM(lc_AdminUser) + CHR(0)+ ;
"PWD=" + ALLTRIM(lc_AdminPassword) + CHR(0)

fResult = SQLConfigDataSource(0, 4, @lc_driver, @lc_dsn)

I don't get any error message and the DSN is created, but withou the
currentschema.
Any help would be appreciated.

Alan
I don't know if you can set that parameter, hoipefully someone else
will respond. I'd just like to note that the SCHEMA can be SET after
the CONNECT by passing the statement: SET SCHEMA <schema>;.

B.

Dec 15 '06 #4

Al**********@gmail.com wrote:
Hi,

I need to create a DB2 system DSN programmatically. I need to set the
currentschema parameter to be equal to the appropriate database name. I
am able to create the DSN ok, but am unable to add the currentschema
parameter. I am using visual fox pro 9. My code follows:

lc_driver = "IBM DB2 ODBC DRIVER" + CHR(0)

lc_dsn = "DESCRIPTION=Connection Description" + CHR(0)+ ;
DSN=TEST" + CHR(0)+ ;
"DBALIAS=" + ALLTRIM(UPPER(lc_DBAlias)) + CHR(0)+ ;
"CURRENTSCHEMA=" + ALLTRIM(UPPER(lcDatabase)) + CHR(0)+ ;
"UID=" + ALLTRIM(lc_AdminUser) + CHR(0)+ ;
"PWD=" + ALLTRIM(lc_AdminPassword) + CHR(0)

fResult = SQLConfigDataSource(0, 4, @lc_driver, @lc_dsn)

I don't get any error message and the DSN is created, but withou the
currentschema.
Any help would be appreciated.

Alan
I don't know if you can set that parameter, hoipefully someone else
will respond. I'd just like to note that the SCHEMA can be SET after
the CONNECT by passing the statement: SET SCHEMA <schema>;.

B.

Dec 15 '06 #5
Al**********@gmail.com wrote:
Hi,

I need to create a DB2 system DSN programmatically. I need to set the
currentschema parameter to be equal to the appropriate database name. I
am able to create the DSN ok, but am unable to add the currentschema
parameter. I am using visual fox pro 9. My code follows:

lc_driver = "IBM DB2 ODBC DRIVER" + CHR(0)

lc_dsn = "DESCRIPTION=Connection Description" + CHR(0)+ ;
DSN=TEST" + CHR(0)+ ;
"DBALIAS=" + ALLTRIM(UPPER(lc_DBAlias)) + CHR(0)+ ;
"CURRENTSCHEMA=" + ALLTRIM(UPPER(lcDatabase)) + CHR(0)+ ;
"UID=" + ALLTRIM(lc_AdminUser) + CHR(0)+ ;
"PWD=" + ALLTRIM(lc_AdminPassword) + CHR(0)

fResult = SQLConfigDataSource(0, 4, @lc_driver, @lc_dsn)

I don't get any error message and the DSN is created, but withou the
currentschema.
Any help would be appreciated.

Alan
I don't know if you can set that parameter, hoipefully someone else
will respond. I'd just like to note that the SCHEMA can be SET after
the CONNECT by passing the statement: SET SCHEMA <schema>;.

B.

Dec 15 '06 #6

Al**********@gmail.com wrote:
Hi,

I need to create a DB2 system DSN programmatically. I need to set the
currentschema parameter to be equal to the appropriate database name. I
am able to create the DSN ok, but am unable to add the currentschema
parameter. I am using visual fox pro 9. My code follows:

lc_driver = "IBM DB2 ODBC DRIVER" + CHR(0)

lc_dsn = "DESCRIPTION=Connection Description" + CHR(0)+ ;
DSN=TEST" + CHR(0)+ ;
"DBALIAS=" + ALLTRIM(UPPER(lc_DBAlias)) + CHR(0)+ ;
"CURRENTSCHEMA=" + ALLTRIM(UPPER(lcDatabase)) + CHR(0)+ ;
"UID=" + ALLTRIM(lc_AdminUser) + CHR(0)+ ;
"PWD=" + ALLTRIM(lc_AdminPassword) + CHR(0)

fResult = SQLConfigDataSource(0, 4, @lc_driver, @lc_dsn)

I don't get any error message and the DSN is created, but withou the
currentschema.
Any help would be appreciated.

Alan
I don't know if you can set that parameter, hoipefully someone else
will respond. I'd just like to note that the SCHEMA can be SET after
the CONNECT by passing the statement: SET SCHEMA <schema>;.

B.

Dec 15 '06 #7
On Dec 15 2006, 4:27 am, Alan.Squi...@gmail.com wrote:
Hi,

I need to create a DB2 system DSN programmatically. I need to set the
currentschema parameter to be equal to the appropriate database name. I
am able to create the DSN ok, but am unable to add the currentschema
parameter. I am using visual fox pro 9. My code follows:

lc_driver = "IBM DB2 ODBC DRIVER" + CHR(0)

lc_dsn = "DESCRIPTION=Connection Description" + CHR(0)+ ;
DSN=TEST" + CHR(0)+ ;
"DBALIAS=" + ALLTRIM(UPPER(lc_DBAlias)) + CHR(0)+ ;
"CURRENTSCHEMA=" + ALLTRIM(UPPER(lcDatabase)) + CHR(0)+ ;
"UID=" + ALLTRIM(lc_AdminUser) + CHR(0)+ ;
"PWD=" + ALLTRIM(lc_AdminPassword) + CHR(0)

fResult = SQLConfigDataSource(0, 4, @lc_driver, @lc_dsn)

I don't get any error message and the DSN is created, but withou the
currentschema.
Any help would be appreciated.

Alan
Hi Alan,
I need a help from you. I need to create System DSN for
DB2 database.
I have installed DB2 8.6 with Fixpack6.

I am passing everything correctly. But it fails at SQLConfigDataSource
function.

I would like to know which version of DB2 you used.

FYI:
I am able to create System DSN through Control Panel.

I am able to create System DSN for DB2 version9.0 through Control
Panel as well as through Program.
But i am not able to create one for DB2 version 8.2 programatically.

Thanks
Senthil
Jan 31 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in...
2
by: Scott | last post by:
Not sure if this is the right place to post this or not, but I am in the process of trying to find a Web Hosting/Isp Billing system that is reasonable in price and uses Access or SQL Server for a...
0
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520"...
5
by: laks | last post by:
Hi I have the following xsl stmt. <xsl:for-each select="JOB_POSTINGS/JOB_POSTING \"> <xsl:sort select="JOB_TITLE" order="ascending"/> This works fine when I use it. But when using multiple...
0
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
1
by: Sky | last post by:
Yesterday I was told that GetType(string) should not just be with a Type, but be Type, AssemblyName. Fair enough, get the reason. (Finally!). As long as it doesn't cause tech support problems...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
2
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, I am wondering why the .NET Framework is quite different from Win32 API when it comes to displaying system modal message boxes. Consider the four following types of system modal message...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.