Click here to Skip to main content
15,920,708 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Web Application related query Pin
Vijaya Krishnamoorthy5-May-06 23:47
Vijaya Krishnamoorthy5-May-06 23:47 
QuestionLow virtual memory Pin
SwatiPathania5-May-06 19:10
SwatiPathania5-May-06 19:10 
QuestionAdding values to tree view nodes Pin
lupa-nikki5-May-06 18:57
lupa-nikki5-May-06 18:57 
QuestionRead Arabic File Pin
shereem khaleel5-May-06 14:55
shereem khaleel5-May-06 14:55 
AnswerRe: Read Arabic File Pin
ISIS555-May-06 21:27
ISIS555-May-06 21:27 
GeneralRe: Read Arabic File Pin
shereem khaleel6-May-06 23:25
shereem khaleel6-May-06 23:25 
AnswerRe: Read Arabic File Pin
microuser_20005-May-06 23:28
microuser_20005-May-06 23:28 
QuestionADO Connection problem Pin
Quecumber2565-May-06 10:31
Quecumber2565-May-06 10:31 
Hi Everyone:
I have not been receiving any ressponses lately, but we will try again.

I’m trying an experiment in ADO database connections. I have two MS-Access 2000 databases. One is password protected, the other isn’t.

I have two functions to make connections to the database using ADO.
With login data:
Public Function Jet_Connect_Login(ByVal strProv, ByVal strDB, ByVal strUser, ByVal strPasswd) As Integer
On Error GoTo Jet_Connect_Login_Err
Set cnnMainDb = New ADODB.Connection
With cnnMainDb
.ConnectionString = "Provider=" & strProv & ";Data Source=" & strDB & _
";User ID=" & strUser & ";Password=" & strPasswd & ";"
.Open
Jet_Connect_Login = .State
End With

Jet_Connect_Login_Exit:
Exit Function

Jet_Connect_Login_Err:
Select Case Err.Number
Case adErrObjectOpen
If cnnMainDb.State = 1 Then
cnnMainDb.Close
Set cnnMainDb = Nothing
End If
Resume Jet_Connect_Login_Exit
Case Else
Msg = "Error in Startup module - Establish_Connection function. " & vbCr & _
"Error # " & Str(Err.Number) & " was generated by " _
& Err.Source & vbCr & Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
If cnnMainDb.State = 1 Then
cnnMainDb.Close
Set cnnMainDb = Nothing
End If
Resume Jet_Connect_Login_Exit
End Select
End Function

Without login data:
Public Function Jet_Connect_Std(ByVal strProv As String, ByVal strDBName As String) As Integer
On Error GoTo Jet_Connect_Std_Err
Set cnnMainDb = New ADODB.Connection
With cnnMainDb
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBName

.Open
Jet_Connect_Std = .State
End With

Jet_Connect_Std_Exit:
Exit Function

Jet_Connect_Std_Err:
Select Case Err.Number
Case adErrObjectOpen
If cnnMainDb.State = 1 Then
cnnMainDb.Close
Set cnnMainDb = Nothing
End If
Resume Jet_Connect_Std_Exit
Case Else
Msg = "Error in Startup module - Establish_Connection function. " & vbCr & _
"Error # " & Hex(Str(Err.Number)) & " was generated by " _
& Err.Source & vbCr & Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
If cnnMainDb.State = 1 Then
cnnMainDb.Close
Set cnnMainDb = Nothing
End If
Resume Jet_Connect_Std_Exit
End Select
End Function

The Connection function without the logon works fine, but the one requiring log on information is giving me the following error:
Error in Startup module – Establish_Connect function.
Error# -2147217843 was generated by Microsoft JET Database engine.
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.

Thank you,


Quecumber256
QuestionHELP Vb.NET Cannot Inherit from System.ComponentModel.Design.CollectionEditor.CollectionForm Pin
eatwork5-May-06 6:02
eatwork5-May-06 6:02 
AnswerRe: HELP Vb.NET Cannot Inherit from System.ComponentModel.Design.CollectionEditor.CollectionForm Pin
Dave Kreskowiak5-May-06 6:59
mveDave Kreskowiak5-May-06 6:59 
GeneralRe: HELP Vb.NET Cannot Inherit from System.ComponentModel.Design.CollectionEditor.CollectionForm Pin
eatwork5-May-06 8:46
eatwork5-May-06 8:46 
GeneralRe: HELP Vb.NET Cannot Inherit from System.ComponentModel.Design.CollectionEditor.CollectionForm Pin
Dave Kreskowiak5-May-06 9:26
mveDave Kreskowiak5-May-06 9:26 
GeneralRe: HELP Vb.NET Cannot Inherit from System.ComponentModel.Design.CollectionEditor.CollectionForm Pin
eatwork5-May-06 9:52
eatwork5-May-06 9:52 
Questioncapture keypress using windows services Pin
ramesh.samiappan5-May-06 5:36
ramesh.samiappan5-May-06 5:36 
QuestionChanging routing table Pin
mjackson115-May-06 5:19
mjackson115-May-06 5:19 
AnswerRe: Changing routing table Pin
Dave Kreskowiak5-May-06 5:48
mveDave Kreskowiak5-May-06 5:48 
GeneralRe: Changing routing table Pin
mjackson115-May-06 8:24
mjackson115-May-06 8:24 
GeneralRe: Changing routing table Pin
Dave Kreskowiak5-May-06 9:24
mveDave Kreskowiak5-May-06 9:24 
GeneralRe: Changing routing table Pin
mjackson115-May-06 12:20
mjackson115-May-06 12:20 
GeneralRe: Changing routing table Pin
Dave Kreskowiak6-May-06 4:15
mveDave Kreskowiak6-May-06 4:15 
QuestionAdding records in a datasheet form Pin
mjackson115-May-06 3:13
mjackson115-May-06 3:13 
AnswerRe: Adding records in a datasheet form Pin
Dave Kreskowiak5-May-06 5:43
mveDave Kreskowiak5-May-06 5:43 
GeneralRe: Adding records in a datasheet form Pin
mjackson115-May-06 8:30
mjackson115-May-06 8:30 
QuestionDATAGRID Pin
Member 28660305-May-06 2:53
Member 28660305-May-06 2:53 
AnswerRe: DATAGRID Pin
Dave Kreskowiak5-May-06 5:34
mveDave Kreskowiak5-May-06 5:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.