Click here to Skip to main content
15,906,341 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Public Function gSQL(ByVal strSQL As String) As ADODB.Recordset
        Dim cnn As ADODB.Connection
        Dim rs As ADODB.Recordset
        Dim cmd As ADODB.Command
        Dim strcnn As String
        cnn = New ADODB.Connection
        cmd = New ADODB.Command
        rs = New ADODB.Recordset
        strcnn = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=C:\Program Files\Att2008\att2000.mdb"
        If cnn.State = ConnectionState.Open Then
            cnn.Close()
        End If
        cnn.Open(strcnn) 'this part is raising an error but all it says is "unspecified error"
        cmd.let_ActiveConnection(cnn)
        cmd.CommandType = ADODB.CommandTypeEnum.adCmdText
        cmd.CommandText = strSQL
        rs.CursorLocation = ADODB.CursorLocationEnum.adUseClient
        rs.CursorType = ADODB.CursorTypeEnum.adOpenStatic
        rs.LockType = ADODB.LockTypeEnum.adLockOptimistic
        rs.Open(cmd)
        gSQL = rs
    End Function


what could be the possible reason and workaround for this kind of error. what confuses me is there is one computer that my program is running smoothly but on the other computers its not. does the processor of the computer can be a factor for this?

on the computer that the program is working i have a P4 2.4GH processor and 512MB
the other computer have a higher specs.. like iCore 3 and about 2gb memory..

please help me to fix this prob.. thanks in advance..
Posted

1 solution

Two solutions :

1. Change the location of the database file. Anywhere except "c:/" or "Program Files" or System Folders.

2. Change the permissions of the application by changing the manifest file.

Search
VB
<requestedexecutionlevel level="asInvoker" uiaccess="false" /> 

and replacing
VB
"asInvoker"
to
VB
"requireAdministrator"


Though the first one is both feasible and hasle free. Do let me know if it worked.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900