Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with a connection string
Message
De
30/09/2008 00:46:56
 
 
À
29/09/2008 18:30:40
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01351672
Message ID:
01351707
Vues:
17
>Hi, I'm new at this and i'm having problems with a connection string, this is my code:
>
>
>
>
>    Sub Page_Load(ByVal obj As Object, ByVal e As EventArgs)
>        If IsPostBack() Then
>            Dim objConn As New OleDbConnection("Provider=SQLOLEDB; Data Source=db2fx981\comware;Initial Catalog=SIP;User Id=sa;Password=;")
>            objConn.Open()
>            REM "Provider=SQLOLEDB; Server=db2fx981\comware;Database=SIP;Trusted_Connection=True;Uid='Edgar Salcedo';Pwd=4116734-1")
>            Dim sSQL, Resul As String
>            sSQL = "Insert into tClientes (Descripcion) values ('" & Descripcion.Text & "')"
>            Dim objCmd As New OleDbCommand(sSQL, objConn)
>            
>            Resul = objCmd.ExecuteNonQuery
>            If Resul Then
>                Response.Write("Se ha agregado correctamente el registro")
>            End If
>        End If
>    End Sub
></script>
>
>
>The problem shows up when goes to ObjConn displaying an error:
>Login failed for 'sa'. The user is not associated with a trusted SQL Server Connection.
>How can I solve this?

You show 2 different connection strings - one starting with Dim objConn, the other with REM "Provider ...

Are you trying to connect with a trusted connection, or via a SQL Server account? You may need to check that the SQL Server instance is configured to support the logon type you're trying to use.

A good site for general connection string information is, unsurprisingly, http://www.connectionstrings.com
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform