compare your connection string to the one @
http://www.learnasp.com/freebook/learn/dbopen.aspx

also in the catch ...
 Catch ex As Exception
     Label1.Text = ex.Message()
finally
 
would give you a better message to work with.



Also 

On 9/13/05, urmila nalla <[EMAIL PROTECTED]> wrote:
>     
>  see the following code where i am trying to connect to access database...at 
> the end i am not able to open the conncetion which i can identify through the 
> statement
>  
>  label1.text=cn.state ...i wrote this code in page load when i am running 
> this code i am getting label1.text as 0...
>  
>  waiting for reply..
>  
>   
>  
>  Dim strconn As String
>  
>  strconn = "provider=microsoft.jet.oledb.4.0;datasource=f:\db2.mdb"
>  
>  Dim cn As OleDb.OleDbConnection 
>  
>  cn = New OleDb.OleDbConnection
>  
>  cn.ConnectionString = strconn
>  
>  Try
>  
>  cn.Open()
>  
>  Catch ex As Exception
>  
>  Console.WriteLine("Attempt to connect failed!" & vbCrLf & ex.Message)
>  
>  finally
>  
>  Label1.Text = cn.State
>  
>  End Try
>  
>  bye
>  
>  urmila.
>  
>  
>  __________________________________________________
>  Do You Yahoo!?
>  Tired of spam?  Yahoo! Mail has the best spam protection around 
>  http://mail.yahoo.com 
>  
>  [Non-text portions of this message have been removed]
>  
>              
> 
>    
>      SPONSORED LINKS                                 
>                       Basic programming language                              
>          Computer programming languages                                       
> Programming languages                                               
>                       Java programming language                               
>         The history of computer programming language                          
>                         
>    
>    ________________________________
   YAHOO! GROUPS LINKS  
>  
>    
>  Visit your group "AspNetAnyQuestionIsOk" on the web.
>     
>  To unsubscribe from this group, send an email to:
>  [EMAIL PROTECTED]
>     
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.  
>  
>    ________________________________


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to