Error in OleDbSchemaGUID

prem_rajani

Member
Joined
Jul 19, 2005
Messages
22
Location
Coimbatore
Programming Experience
3-5
Hi,

The connection string is as follows

VB.NET:
[SIZE=2]ConnectDatabase("SQLOLEDB.1", lblDataSource.Text, txtUser.Text, txtPwd.Text, , lblDatabase.Text)[/SIZE]

When I try to retireve views from database I get error as :

The type of schema isnt supported by provider SQLOLEDB.1. The code for retrieving views is

VB.NET:
[SIZE=2]dt = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] DataTable
dt = OleConn.GetOleDbSchemaTable([/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbSchemaGuid().Views, [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Object[/COLOR][/SIZE][SIZE=2]() {[/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE][SIZE=2], "VIEW"})
[/SIZE]

Am I missing something. Pls help me out in this.
 
Silly Mistake

Hi,

Sorry about the earlier mail. Guess I made a small mistake. When I use OleDbSchemaGuid.Views it contains only three restrictions. So when I typed it like this

dt = OleConn.GetOleDbSchemaTable(New OleDb.OleDbSchemaGuid().Views, NewObject() {Nothing, schema_name, Nothing})

I still get the error not supported by SQLOLEDB.1 provider. Then in MSDN site I saw that even with tables & defining table_type as views we can view names. So I tried it this way

dt = OleConn.GetOleDbSchemaTable(New OleDb.OleDbSchemaGuid().Views, NewObject() {Nothing, schema_name, Nothing, "VIEW"})

And this coding worked superbly for both SQL Server & Oracle.

I'm sorry for the mails and will try to be more considerate in future about posting things in hurry.
 
Back
Top