PDA

Click to See Complete Forum and Search --> : ODBC-question


demoti
Mar 2nd, 2004, 03:38 AM
<%@ Import Namespace="System.data.odbc" %>

<script runat = "server">

sub page_load
dim con as odbcconnection
dim cmd as odbccommand
'dim dtr as oledbdatareader

con = new OdbcConnection ("DSN=ASPNET")
con.open

cmd = new odbccommand ("select count(*) from besluit", con)

LBLaantal.text = cmd.executescalar()

con.close()
end sub

</script>

<html>
<head><title>titeltje</title></head>
<body>

<asp:label
ID = "LBLaantal"
Runat = "server" />

</body>
</html>

gives me the error:

ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

when i use ("DSN=ASPNET;uid=testclient;pwd=test") for a connection string, the same error occurs... I'd rather do it without the uid and pwd...

does anyone know what i'm doing wrong? I just want to make a connection with my sql server through a DSN...

help or advice would be greatly appreciated...

demoti
Mar 4th, 2004, 06:28 AM
whatever i try... the same message returns over and over... I'm thinking IIS is not connecting with my domain-username... I found lot's of similar problems on google-groups, but no solutions that would work for me...