473,324 Members | 2,239 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,324 software developers and data experts.

How to create DB2 DSN programmatically

Hi there,
I want to create DSN for DB2 database through my VB application.
I have installed DB2 v8.2 with FixPack6.0 ESE.
(The actual version shown in Control Center is DB2 V8.1.13.193)

The problem is that VB application crashes without reporting any error. DSN is not getting created.
But I am able to create DSN through Control Panel.

Here is the code snippet to create DSN

ODBCDRIVER = "IBM DB2 ODBC DRIVER"
ODBC_ADD_SYS_DSN=4
' Add Application DSN First

att = "DSN=" & AppDSN & Chr$(0)
att = att & "Description=BPF Metastore System DSN" & Chr$(0)
att = att & "DBALIAS=" & AppDB & Chr$(0)
ret = SQLConfigDataSource(0, ODBC_ADD_SYS_DSN, ODBCDRIVER, att) ==> crashes at this line


But the same code creates DSN if i install DB2 v 9.1


Your help would be appreciated

Regards
Senthil
Feb 2 '07 #1
0 3611

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Silvia | last post by:
My question is that is posible create a IIS Virtual Directory programmatically with visual Basic.NET?? Is posible create a Application Pool programmatically too? Thanks
4
by: Thomas Jespersen | last post by:
Hello I want to create a MSI file programmatically. Do you know of any third party .NET component which can help me with that? I'm going to use it like a self extracting zip. So it is not...
3
by: G rumpy O ld D uffer | last post by:
This is probably a 'Low-Level' question to all the ACCESS experts but I've only been using ACCESS for a couple of weeks. I've been given 30+ (and counting) separate 'Weekly' Databases which all...
5
by: Jacob | last post by:
Happy New Year! I'm writing a program that will need to store large amounts of data from several DataSets that I create at runtime (for information like email, calendar, etc...). The trick is...
3
by: R Reyes | last post by:
Just wondering if anyone knows the pros/cons between creating a database programmatically vs using the application's tool windows/features that come with SQLServer, Access, Oracle, etc... Is it...
2
by: jjack100 | last post by:
In asp.net 2.0 you can apply custom themes based on a user profile, etc. And you can change the theme programmatically, etc. But how do you edit or create a theme programmatically? I am working on...
14
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate...
1
by: kimkamp | last post by:
I want to create a variable name programmatically. For instance: Dim GlobVar as String = "My.STL." Dim VarName as String = "sAccountNo" Dim VarValue as String = "ABC123" I want to end up...
11
by: =?Utf-8?B?UGV0ZXIgSw==?= | last post by:
I am working with Visual Studio or alternately with Expression Web. I need to create about 50 aspx pages with about 1200 thumbnali images, typically arranged in three to four groups per page,...
10
by: AAaron123 | last post by:
I want to create a database with one table on the host. I can't user SQL Server Management Studio to do it so I guess I have to do it programmatically. I have in mind that in the session start...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.