-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Piriyamanavan
Message 6 in Discussion
Yeah. I am using SQL-Server Client 2000 in machine. I refered SQLDMO DLL in my
project refrence. What else i missed? But the following code working fine and it
creates file also.
oServer = New SQLDMO.SQLServer
' Connect to the SQL Server
oServer.Connect("SDS", "albe", "albe")
' Connect to the "pubs" database
oDatabase = oServer.Databases.Item("pubs")
For Each oTable In oDatabase.Tables
If (Left(oTable.Name, 3) <> "sys") Then
Console.WriteLine("Scripting for {0}", oTable.Name)
For Each oIndex In oTable.Indexes
Console.WriteLine(vbTab & "Scripting {0}", oIndex.Name)
oIndex.Script( _
sqldmoNET.SQLDMO_SCRIPT_TYPE.SQLDMOScript_Default Or _
sqldmoNET.SQLDMO_SCRIPT_TYPE.SQLDMOScript_AppendToFile Or _
sqldmoNET.SQLDMO_SCRIPT_TYPE.SQLDMOScript_Drops Or _
sqldmoNET.SQLDMO_SCRIPT_TYPE.SQLDMOScript_IncludeHeaders, _
"C:\Temp\AllIndexes.sql", _
sqldmoNET.SQLDMO_SCRIPT2_TYPE.SQLDMOScript2_Default)
Next
End If
Next
' Cleanup all resources
oServer.Application.Quit()
If you want to see my code(error giving), I will send u. Tell me ur opinion.
Thanks
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bDOTNET/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]