Results 1 to 2 of 2

Thread: ODBC-question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Location
    Gent
    Posts
    166

    Question ODBC-question

    Code:
    <%@ 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...
    never argue with an idiot, he will bring you down to his level and will beat you through experience

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Location
    Gent
    Posts
    166
    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...
    never argue with an idiot, he will bring you down to his level and will beat you through experience

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width