473,763 Members | 2,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ODBC MySQL - Problems.

Hi...

I am trying to do a "basic" ODBC connection to my MYSQL Database being
hosted at discountasp. For the life of me, I can't get anything to return...
could someone lend a hand? Here is my code:

--------------------------------

string MyConString = "DRIVER={My SQL ODBC 3.51 Driver};" +
"SERVER=hostnam eatdiscountasp; " +
"DATABASE=myass igneddatabase;" +
"UID=;" +
"PASSWORD=; " +
"OPTION=3";

OdbcConnection MyConnection = new OdbcConnection( MyConString);
MyConnection.Op en();

OdbcCommand MyCommand = new OdbcCommand();
MyCommand.Comma ndText = "SELECT * FROM sometesttable";

OdbcDataReader MyDataReader;

MyDataReader = MyCommand.Execu teReader();

while (MyDataReader.R ead())
{
Label1.Text = MyDataReader.Ge tString(1);
}

MyDataReader.Cl ose();
MyConnection.Cl ose();

----------------------------

Any ideas on what might be the problem?

Thanks a bunch.

Matthew Workman
TLWI

Nov 15 '05 #1
1 1234
Matthew,

Are you getting no records returned, or are you getting an exception?
Can you be more specific about what the problem is?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Matthew Workman" <di*******@hotm ail.com_REMOVEM E> wrote in message
news:u$******** *****@tk2msftng p13.phx.gbl...
Hi...

I am trying to do a "basic" ODBC connection to my MYSQL Database being
hosted at discountasp. For the life of me, I can't get anything to return... could someone lend a hand? Here is my code:

--------------------------------

string MyConString = "DRIVER={My SQL ODBC 3.51 Driver};" +
"SERVER=hostnam eatdiscountasp; " +
"DATABASE=myass igneddatabase;" +
"UID=;" +
"PASSWORD=; " +
"OPTION=3";

OdbcConnection MyConnection = new OdbcConnection( MyConString);
MyConnection.Op en();

OdbcCommand MyCommand = new OdbcCommand();
MyCommand.Comma ndText = "SELECT * FROM sometesttable";

OdbcDataReader MyDataReader;

MyDataReader = MyCommand.Execu teReader();

while (MyDataReader.R ead())
{
Label1.Text = MyDataReader.Ge tString(1);
}

MyDataReader.Cl ose();
MyConnection.Cl ose();

----------------------------

Any ideas on what might be the problem?

Thanks a bunch.

Matthew Workman
TLWI

Nov 15 '05 #2

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

Similar topics

0
1660
by: Nico den Boer | last post by:
Hi all, I'm working with: MySql: Database server: mysql-4.1.7-essential-win ODBC driver: MyODBC-3.51.10-x86-win-32bit Administrator: mysql-administrator-1.0.14-win Query browser: mysql-query-browser-1.1.2-win
1
2143
by: rguti | last post by:
Anybody know when the new version of the ODBC Driver is gonna be out? I'm using 3.51.11-1, but I'm having problems transferring information from SQL Server. Thanks.
11
17570
by: DJJ | last post by:
I am using the MySQL ODBC 3.51 driver to link three relatively small MySQL tables to a Microsoft Access 2003 database. I am finding that the data from the MySQL tables takes a hell of a long time to load making any kind linkage with my Access data virtually useless. I have the MySQL driver setup in as a USER DSN. The MySQL data is sitting out on a server and the Access database is running locally. The network connection is very...
2
2250
by: uli2003wien | last post by:
Dear group, we are dealing with some very specific problems with ODBC, where a connection from SQL-Server to Mysql works with ODBC-driver 3.51.10.00 and does NOT work with ODBC-driver 3.51.11.00. Maybe someone experiences similar problems or even has a solution ? Some feedback (to the group) would be highly appreciated. We use a Microsoft SQL-Server as Headquarter database and some Mysql-machines on Redhat as satellite-databases. We...
0
1559
by: uli2003wien | last post by:
Dear MS-SQL-Server-group maybe my message for MySQL is also for you of interest, since the MS-SQL-Server and it's binary_checksum function is involved ================================================================= Dear group, we are dealing with some very specific problems with ODBC, where a connection from SQL-Server to Mysql works with ODBC-driver 3.51.10.00
13
8293
by: Eric E | last post by:
Two questions regarding ODBC. 1) I am connecting to a MySQL database using the following code: Function LoginToMySQL(sUsername As String, sPW As String) As Boolean Dim dbMySQL As Database Dim cnMySQL As DAO.Connection Dim sDSN As String sDSN = "ODBC;DRIVER={MySQL ODBC 3.51 Driver};" _ & "SERVER=127.0.0.1;" _
2
2423
by: csgraham74 | last post by:
Hello, im using MS Access as a front end to link to MYSQL. although this is possibly an Access issue i thought someone would be able to help me. the error message "ODBC--insert on a linked table 'tablname' failed" is displayed when i attempt to insert records to the MYSQL table. Does anyone know of a way round this ?? im using the most recent MYSQL driver and i have only text fields in my insert statement.
3
4366
by: Mike | last post by:
I have transferred the data from Access to MySQL using MySQL's tool. The transfer worked great and saved me a lot of time (thanks MySQL). Now I'm trying to get the Access database, or a new access database, to talk across ODBC and see the data. I created the DSN through the control panel and it works without error. How do I setup Access so it can see the data. The data
1
2212
by: JustMe | last post by:
Hi all, Although I've got quite a lot of experience with php and (M/My)SQL, I only used both within an online php script. These last few months I bought an option with my webhost to access the remote database via ODBC via my homePC. I use MS Access (linked tables) on my PC, just because it's very easy to make new reports / forms / querys / ... And, in principle, it should work, shouldn't it? And it does... most of the time,...
2
5942
by: dronkanoki | last post by:
I am attempting to set up myODBC 3.51 on Win XP Pro to a remote MySQL Linux server. I get the following error: Access denied for user: 'username@ipaddress.serviceprovider.net' (Using password: YES) I had MySQL installed locally for testing, and myODBC worked fine. All the other apps I use locally (Dreamweaver, PHPmyAdmin, MySQL Front) work great on the remote server with the same login info. This is my thought (patience, please). My...
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9383
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10140
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9935
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7364
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5268
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3519
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2790
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.