Compare two tables
Compare two tables
Compare two tables
Compare two tables
Compare two tables
Compare two tables Compare two tables Compare two tables Compare two tables Compare two tables Compare two tables Compare two tables Compare two tables
Compare two tables Compare two tables
Compare two tables
Go Back  Xtreme Visual Basic Talk > > > Compare two tables


Reply
 
Thread Tools Display Modes
  #21  
Old 05-13-2004, 02:45 PM
MKoslof's Avatar
MKoslofCompare two tables MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default


OK, give the exact server name and location of the database. VB.net is looking in its project directory because it can not resolve the path:

"\\Eloi\i\Database\Eloi\Data Tables.mdb"

It can't find it. You need to pass in the full UNC path or, try the mapped directory if present

T:\some folder\mymdb.mdb
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #22  
Old 05-14-2004, 07:17 AM
VisuallyImpared's Avatar
VisuallyImpared VisuallyImpared is offline
Junior Contributor
 
Join Date: Sep 2002
Location: Toronto, Canada
Posts: 278
Default

Quote:
Originally Posted by MKoslof
OK, give the exact server name and location of the database. VB.net is looking in its project directory because it can not resolve the path:

"\\Eloi\i\Database\Eloi\Data Tables.mdb"

It can't find it. You need to pass in the full UNC path or, try the mapped directory if present

T:\some folder\mymdb.mdb

Ok, i have almost got this working. BUT


1. First question, how do I get rid of all these temp tables I cant find them, but when I run the code I have to keep incrementin the number (temptable23) to get the code to run. Gotta purge!

2. everything works but i get this error
Quote:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Service and Support Record Centre.exe

Additional information: The Microsoft Jet database engine cannot find the input table or query 'TempTable23'. Make sure it exists and that its name is spelled correctly.

my code now looks like this:
Code:
Private Sub frmUpload_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cn As ADODB.Connection Dim strString As String Dim myQuery As String Dim rs As ADODB.Recordset cn = New ADODB.Connection 'notice I changed this line because we give the connection string below V strString = "SELECT * INTO TempTable23 FROM [tbl Contacts]" cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= \\Eloi\i\Database\Eloi\Data Tables.mdb ;Persist Security Info=false;" cn.Open() cn.Execute(strString) cn.Close() cn = Nothing cn = New ADODB.Connection rs = New ADODB.Recordset 'this returns a recordset myQuery = "SELECT * FROM TempTable23 UNION Select * FROM [tbl Contacts] " 'cn.ConnectionString = 'cn.Open() rs.Open(myQuery, "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= c:\Eloi\i\Database\Eloi\Data Tables.mdb ;Persist Security Info=false;", _ ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) 'do something with your combined, distinct records MsgBox(rs.RecordCount) rs.close() cn.Close() rs = Nothing cn = Nothing End Sub

P.S. I really appreciate all your time and effort on this.
__________________
Win Win Situation: Swapping my salary with my golf score

Last edited by VisuallyImpared; 05-14-2004 at 08:30 AM.
Reply With Quote
  #23  
Old 05-14-2004, 07:24 AM
MKoslof's Avatar
MKoslofCompare two tables MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Sigh...visually, look at your connection strings.

You created TempTable23 on the NETWORK database, look at the query my freind. Then, you try to reference the table on your local mdb, where it doesn't exist

__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #24  
Old 05-14-2004, 07:43 AM
VisuallyImpared's Avatar
VisuallyImpared VisuallyImpared is offline
Junior Contributor
 
Join Date: Sep 2002
Location: Toronto, Canada
Posts: 278
Default

Quote:
Originally Posted by MKoslof
Sigh...visually, look at your connection strings.

You created TempTable23 on the NETWORK database, look at the query my freind. Then, you try to reference the table on your local mdb, where it doesn't exist



HA HA HA HA HA !!!!!!!!!!

FIXED IT!

I am so smart, I am so smart, S-M-R-T I mean S-M-A -R-T


Jeebus that was a little like pulling teeth.. That last post really made the light come on.

Sorry for ALL the confusion but when an SQL call gets beyond SELECT * From TableX I start geting confused .


thankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthanky outhankyou
__________________
Win Win Situation: Swapping my salary with my golf score
Reply With Quote
  #25  
Old 05-14-2004, 08:59 AM
MKoslof's Avatar
MKoslofCompare two tables MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

No problem, we got there in the end. Good luck
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare two tables TomG Database and Reporting 4 12-03-2003 10:14 AM
SQL Query - Compare 2 Tables jmull Database and Reporting 10 10-28-2003 12:00 PM
Compare two tables PrOpHeT Database and Reporting 12 12-17-2002 11:39 AM
compare tables john8675309 Database and Reporting 0 09-11-2002 05:12 PM
Creating new tables and links scribbles Database and Reporting 11 08-30-2002 06:18 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Compare two tables
Compare two tables
Compare two tables Compare two tables
Compare two tables
Compare two tables
Compare two tables Compare two tables Compare two tables Compare two tables Compare two tables Compare two tables Compare two tables
Compare two tables
Compare two tables
 
Compare two tables
Compare two tables
 
-->