Click here to Skip to main content
16,015,531 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys....i am trying to connect my Sybase database to my aspx page..using the code below...

Dim myConnection As OdbcConnection
Dim sConnString As String = _
"Driver={SQL Server};" & _
"Server=kcncdata;" & _
"Database=kcncdata;" & _
"Uid=dba;" & _
"Pwd=sql"
myConnection = New OdbcConnection(sConnString)
myConnection.Open()
Dim roll, name As String
roll = txtroll.Text
name = txtname.Text
Dim myInsertQuery As String = "INSERT INTO dummy (rollno, name) Values('roll', 'name')"
Dim mycommand As New OdbcCommand(myInsertQuery)
mycommand.ExecuteNonQuery()
myConnection.Close()

but i am getting the following error...

"ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect())."

can u help me please to find a solution for the same....?
Posted

1 solution

The connection string you are using will not connect to a Sybase database it is for a SQL Server database.

Have a look here[^] for connection strings.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900