Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / October 2007



Tip: Looking for answers? Try searching our database.

Activex Creation Error executing CreateObject("ADODB.Field")

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dan.forest@matrikon.com - 19 Oct 2007 18:45 GMT
A simple VBScript with the line:

Set oFld = CreateObject("ADODB.Field")

causes an error that the object cannot be created. I've seen various
examples of this so I'm sure it must work. Can anyone tell me why this
wouldn't work? Thanks.

Dan
Walter Wang [MSFT] - 22 Oct 2007 06:53 GMT
Hi Dan,

Welcome to MSDN Managed Newsgroup!

Please note that ADODB.Field is an interface instead of a coclass (COM
Class), you can only use CreateObject (CoCreateInstance/CoCreateInstanceEx
in win32 api) to create an instance of COM class.

I assume your objective here is to manipulate data catalog and create new
fields in a database table, right? If this is the case, you should use ADOX:

#Column Object (ADOX)
http://msdn2.microsoft.com/en-us/library/ms676554.aspx

I hope I haven't misunderstood anything in your question. Please feel free
to let me know if you need further information. Thanks.

Sincerely,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Walter Wang [MSFT] - 22 Oct 2007 06:55 GMT
Hi Dan,

Here's some example code on how to use ADOX to manipulate database
structures:

#4GuysFromRolla.com - Working with ADOX
http://www.4guysfromrolla.com/webtech/013101-1.shtml

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
dan.forest@matrikon.com - 25 Oct 2007 15:42 GMT
On Oct 21, 11:55 pm, waw...@online.microsoft.com ("Walter Wang
[MSFT]") wrote:
> HiDan,
>
[quoted text clipped - 13 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.

Thanks Walter. I had a feeling that ADOX might be the solution, but I
wasn't sure. I ended up solving the problem another way, but I will
have a look at those examples for future reference.

Dan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.