Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a project on visual basic 6 and I export it to Visual 2008 using the wizard. I have some conflicts with some variable declarations. I'm using the Microsoft DAO 3.6 object library like reference and some variables was declared on this way

I added the reference in visual studio.

Global DB As Database
Global DB2 As Database
Global DBSYS As Database
Global RSICSetup As Recordset
Global RSAPDoc As Recordset
Global RSAPTran As Recordset
Global RSVendor As Recordset
Global RSBatch As Recordset


and been made it the migration I have this conflicts:

Error 2 'Database' is ambiguous in the namespace 'DAO'.


if someone know how change or which's the way to left be declared on visual studio

thanks
Posted

1 solution

I suggest that you use the System.Data.SqlClient Namespace.

VB
Imports System.Data
Imports System.Data.SqlClient

Friend objConnection As SqlConnection
Friend objCommand As SqlCommand
Friend objRecordSet As SqlDataReader


See System.Data.SqlClient Namespace[^]

There are a lot of examples using the System.Data.SqlCllient namespace available on various Internet sites. Here are few of the articles on CodeProject that show sample code:

ADO.NET Data Access Component for SQL Server in C# and VB.NET[^]

Using SQLDataReader and SQLDataAdapter[^]

Save and Retrieve Image from a SQL Server Database using VB.NET[^]

SqlCommand Generator[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900