473,396 Members | 1,785 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,396 software developers and data experts.

connect VB net and MS Access ODBC: odbcConnection reference error

24
everything works except for the Dim con As New OdbcConnection("DSN=yoh;")

why?

thanks!


Expand|Select|Wrap|Line Numbers
  1. imports System.Data.Odbc
  2.  
  3. Public Class Class1
  4.     Dim con As New OdbcConnection("DSN=yoh;")
  5.     Dim cmd As New OdbcCommand
  6.  
  7.     Public neym As String
  8.  
  9.     Public Sub New()
  10.         con.Open()
  11.  
  12.         cmd.Connection = con
  13.         cmd.CommandText = "SELECT * FROM table1"
  14.  
  15.     End Sub
  16.  
  17.     Public Sub creates()
  18.         cmd.CommandText = "INSERT INTO table1(Neyms) VALUES('" + neym + "')"
  19.         cmd.ExecuteNonQuery()
  20.  
  21.     End Sub
Mar 18 '11 #1
1 3261
yarbrough40
320 100+
are you sure this "yoh" data source is configured properly?
You may want to try to connect to the access database directly.
Expand|Select|Wrap|Line Numbers
  1. con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Folder1\Folder2\MyAccessDatabase.mdb"
Mar 20 '11 #2

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

Similar topics

2
by: jj | last post by:
I have one access database on the desktop and another access database on a remote web server. Is there any way to setup an ODBC link between the two? I've tried adding IP addresses and even...
1
by: ishabir | last post by:
I have quite a few Oracle linked tables into my Access(97) database. But when you want to open a table get a pop window to enter Username, Password and Server. What I am trying to do is put some...
0
by: olliver.mierau | last post by:
Hi, I have a Access 2000 database which store in some tables about 500.000 recordsets. As the performance is not very impressive I created a table in a MySQL database and connected via ODBC. If I...
0
by: Lewt | last post by:
I am aware of the 'hack the registry' approach. This is just not a safe way to accomplish this on a user's PC. I need to do this the right way. Is there anyone -perhaps from Microsoft - out there...
2
by: Jeff | last post by:
I'm getting an Object Reference error before I even run my app, and I'm not sure where to look to find the cause. I'd appreciate your help. When I open my Windows Application project, the...
0
by: t0nt0n | last post by:
i have an xp OS service pack 2 currently working on a project that uses ms access 2003 with mysql 5.0 backend... i get an odbc--call failed error when I manually changed the system date in my...
16
by: network-admin | last post by:
We have Problems with Access query on Oracle 10g Database with ODBC Connection. The Query_1 is such as select * from xtable where ycolumn <"S" Result = ODBC Faild...
6
seligerasmus
by: seligerasmus | last post by:
Greetings, I'm having a bit of trouble with a small web service I've been writing, specifically with the connectivity aspect of the service. My scenario is as follows : I'm using the IBM...
5
by: kchang | last post by:
I am trying to view my reports based on a linked table database. However both the reports and the queries they're based on give me a "odbc--call failed" error. When I click on help it cites error...
4
by: Jeff | last post by:
I need to export MySQL data to Access. As always, there seems to be more than one way to do this. I notice that PHP has: DB.php If I was doing this in perl, there would be an ODBC driver...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.