Wrox Programmer Forums
|
BOOK: Beginning VB.NET Databases
This is the forum to discuss the Wrox book Beginning VB.NET Databases by Thearon Willis; ISBN: 9780764568008
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning VB.NET Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 15th, 2007, 12:52 AM
Registered User
 
Join Date: Sep 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 2 strSQL statement

In the DataAdapter Class section... I assume the "FROM HR.EMPLOYEES" is a table in the database. I'm not familiar with this type of notation. Two lines down: objDataAdapter.Fill(objDataSet, "Employees") I would have expected both of these tables to appear the same. In other words, I would have expected:
FROM EMPLOYEES or FROM Employees.

I looked for the database that this references but could not find it. There is no chapter 2 folder in the Wrox download and Chapter 1 doesn't have a figure with a table named HR.EMPLOYEES. I'm mostly familiar with DAO and Access. Maybe this is a SQL Server notation?

Thanks

 
Old September 17th, 2007, 05:36 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

HR.EMPLOYEES is the Employees table in the Oracle database that belongs to the HR user. This type of notation is used in both Oracle and SQL Server whereby the table name is prefixed with the owner of the object.

When filling a DataSet with data, objDataAdapter.Fill(objDataSet, "Employees"), we specify a name for the DataTable of Employees. A DataSet can contain multiple DataTable objects and this just helps us to refer to a DataTable by name instead of the index number.

I hope this helps clear up the confusion you had.

Thearon
 
Old September 17th, 2007, 09:12 PM
Registered User
 
Join Date: Sep 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Thearon,

I don't understand what it means to "belong" to HR user but that's okay. I understand that the string HR.EMPLOYEES would be replaced with the table name in my Access database. It took me a while to catch on that I could choose a different table name for the DataSet.

I prefer your book over the others I have because you offer information on OLE DB connections.

Thanks for responding on the forum!

Tom

 
Old September 19th, 2007, 04:43 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Tom,

Let's say you had a user login created in either Oracle or SQL Server and your login had been granted the authority to create database objects (e.g. tables, stored procedures, views). When you create those tables, in this case the Employees table, the table will be prefixed with your login (e.g. Tom.Employees). You are effectlvely the owner of the table and it belongs to you. No one else can access that table unless they are granted permission.

Let me know if this needs further explaination.

Thearon
 
Old September 22nd, 2007, 10:16 AM
Registered User
 
Join Date: Sep 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks,

Now I understand! I've always created an Access database for a particular stand-alone application and never expanded my thinking to the notion of individual owners of tables until now.

Thanks for the responses!

Tom






Similar Threads
Thread Thread Starter Forum Replies Last Post
response.write strSQL shows no values! ronny Classic ASP Databases 3 December 13th, 2007 01:50 PM
Strange Error inh STRSQL alirezaaali Classic ASP Databases 1 August 5th, 2007 11:56 AM
strSQL syntax Christiane Giguere Classic ASP Databases 2 January 25th, 2005 11:06 AM
Strsql setyna Access 4 June 29th, 2004 08:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.