CONNECTIVITY OF SQL 2000 + VB USING ODBC.
steps i Follow-
1) Go to Control panel-->Admintrative Tools-->Double -click
Data sources(ODBC)-->click Add button-->I choose SQL server
(last option), Is it right or wrong option for connecting
to SQL 2000.Then a new screen appears Create a New
dataSource-->in name textbox,we can write anyname--Right or
wrong. suppose i enter sonia, & my server name is .,so I
enter . in server & click next button-->On the Next screen
i have checked the option With Sql server authentication--
>Login Id-sa, Password-->Blank-->Click next button-->Next--
>Finish-->Then I click on button Test Data source-->Mesage
Comes TESTS COMPLETED SUCCESSFULLY-->OK-->OK-->Ok.

These steps we have to do or not for Connectivity using
ODBC.
If yes,then what after these steps we have to do??Plz reply
me early ??Thx in advance.

Answers were Sorted based on User's Feedback



CONNECTIVITY OF SQL 2000 + VB USING ODBC. steps i Follow- 1) Go to Control panel-->Admintrative..

Answer / deepak g

You have to use this DSN name (in your case it is sonia) in
your VB code wherever you wish to establish a connection
between your VB application and your SQL server 2K database.

Is This Answer Correct ?    5 Yes 1 No

CONNECTIVITY OF SQL 2000 + VB USING ODBC. steps i Follow- 1) Go to Control panel-->Admintrative..

Answer / ramu.m

You have to create the DSN programatically by using some
code.

Is This Answer Correct ?    3 Yes 0 No

CONNECTIVITY OF SQL 2000 + VB USING ODBC. steps i Follow- 1) Go to Control panel-->Admintrative..

Answer / vikram

You can used DSN Less Code here (which is more usefull
andimportant insteated of using DSN Coz when you run that
Application on Different PC, then you have to crete DSN
again..)
DSN Less Code for Connection MS ACCESS: or can connect any
db just need to change its provider:
dim con as new adodb.Connection
con.open "provider=microsoft.jet.oledb.4.0;" & "Data
Source= ur db path (there is no space btn Folder and File
Name)"

Is This Answer Correct ?    2 Yes 0 No

CONNECTIVITY OF SQL 2000 + VB USING ODBC. steps i Follow- 1) Go to Control panel-->Admintrative..

Answer / vikas gupta`

you can try this for the perticular user in sql

'Set con = New Connection
'con.ConnectionString = "Provider=SQLOLEDB.1;Integrated
Security=SSPI;Persist Security Info=False;Initial
Catalog=account;Data Source=."
'con.Open
'Set rec = New Recordset
'rec.Open "select * from acc_details", con, adOpenDynamic,
adLockOptimistic

Is This Answer Correct ?    1 Yes 0 No

CONNECTIVITY OF SQL 2000 + VB USING ODBC. steps i Follow- 1) Go to Control panel-->Admintrative..

Answer / abdul khadeer

After creating the DSN. You can use that DSN to access the
DATA.
For Example U Can Use the ADODB connection Object to
connect the Database by using ur DSN created.

For Example Say "Con" is object ADODB.Connection
Then open ur coonection.
Con.Open "MyDSN","UserName","Password"

Now the conection created, Now u can use this connection
object with ur record set oject to retirve the data

Is This Answer Correct ?    0 Yes 0 No

CONNECTIVITY OF SQL 2000 + VB USING ODBC. steps i Follow- 1) Go to Control panel-->Admintrative..

Answer / sri

You also can create the DSN Programatically as follows
Creating DSN Programatically

Private Sub ConfigDSN()
On Error Resume Next
#If Win32 Then
Dim intRet As Long
#Else
Dim intRet As Integer
#End If
Dim strDriver As String
Dim strAttributes As String
Dim msmdbpath As String


' sdPathName = App.path & "\PROJECT.mdb"
strDriver = "Microsoft Access Driver (*.mdb)"
strAttributes = "SERVER=" & Chr$(0)
strAttributes = strAttributes & "DESCRIPTION=OJAL Data
Souce Name" & Chr$(0)
strAttributes = strAttributes & "DSN=INT" & Chr$(0)
strAttributes = strAttributes & "DATABASE=" &
sdPathName & Chr$(0)
strAttributes = strAttributes & "MaxBufferSize=512" &
Chr$(0)
strAttributes = strAttributes & "PageTimeOut=5" & Chr$(0)
strAttributes = strAttributes & "DBQ=" & sdPathName &
Chr$(0)
intRet = SQLConfigDataSource(vbAPINull,
ODBC_CONFIG_DSN, strDriver, strAttributes)
End Sub

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Visual Basic Interview Questions

____ property is used to lock a textbox to enter a datas.

0 Answers  


What is the difference between Msgbox Statement and MsgboxQ function?

0 Answers  


What are the tools in visual basic?

0 Answers  


What is the use of Imagelist Controls

1 Answers  


What do you mean by provider?

0 Answers  






what component is used in vb to link to the database?

2 Answers   Satyam,


How to find size of the file. Which method or function is used to occomplish this?

1 Answers  


Record set types and Number available in Visual Basic?

1 Answers  


What is instantiating?

0 Answers  


What will happen if you issue a Resume statement after handling an error?

3 Answers  


What is the purpose of the ClipControls property on a form or container?

1 Answers  


Write the Steps in Creating an ActiveX Control?

0 Answers  


Categories