Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics 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 March 4th, 2006, 01:54 PM
Authorized User
 
Join Date: May 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to haron_Master Send a message via AIM to haron_Master Send a message via MSN to haron_Master Send a message via Yahoo to haron_Master
Default Please help

Please i need your help how can i connect to my sql server 2000 i'm using visual basic and i want to connect to sql server database please thanks a lot

none
__________________
none
 
Old March 8th, 2006, 09:31 AM
Authorized User
 
Join Date: Mar 2006
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by haron_Master
 Please i need your help how can i connect to my sql server 2000 i'm using visual basic and i want to connect to sql server database please thanks a lot

none
You may use ADO.Connection object.
Peko

 
Old March 12th, 2006, 12:17 PM
Authorized User
 
Join Date: May 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to haron_Master Send a message via AIM to haron_Master Send a message via MSN to haron_Master Send a message via Yahoo to haron_Master
Default

Peko, Thanks for your reply but you know i'm using DAO command if you can can you show me how can i connecto to sql server else in ADO command connection thank you very much

none
 
Old March 13th, 2006, 03:57 AM
Authorized User
 
Join Date: Mar 2006
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First check the referrence for ADO Library (Menu Project => Reference => Microsoft ActiveX Data Objects Library)

Public gobjConnection As ADODB.Connection

Public Sub DBConnect()

  Set gobjConnection = New ADODB.Connection

  'if you use standard security
  gobjConnection.Open "Provider=sqloledb;" & _
                      "Data Source=myServerName;" & _
                      "Initial Catalog=myDatabaseName;" & _
                      "User Id=myUsername;" & _
                      "Password=myPassword"

  'or if you use trusted connection then

  gobjConnection.Open "Provider=sqloledb;" & _
                      "Data Source=myServerName;" & _
                      "Initial Catalog=myDatabaseName;" & _
                      "Integrated Security=SSPI"


End Sub

See MSDN for using ADO.Connection, ADO.Command, ADO.Recordset
Peko


 
Old March 19th, 2006, 03:14 AM
Authorized User
 
Join Date: May 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to haron_Master Send a message via AIM to haron_Master Send a message via MSN to haron_Master Send a message via Yahoo to haron_Master
Default

hello my friend thank you for your reply i just want to ask you please can you show me your code if you can like if i delete my files in database using command delete i can retrieved my files or restore to my database my files thank you?.

none









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