Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Error Being Shown When Connecting To Access Database


i have created the following code:

Dim strconn As New ADODB.Connection
Dim strres As New ADODB.Recordset
Dim sql As String
Dim sUserName As String
Dim sfilename As String

private sub cmd_calculate

sfilename = File1.List(i)

         sql = ""

            sql = " SELECT Employee_Master.UserName as sUserName FROM File_Master " _
            & "INNER JOIN (Employee_Master INNER JOIN File_Detail " _
            & "ON Employee_Master.Emp_ID = File_Detail.Emp_ID) ON " _
            & "File_Master.File_ID = File_Detail.File_ID " _
            & "WHERE (((Employee_Master.Designation)=""PR"") " _
            & "AND ((File_Detail.File_Path)= sfilename))"

            strres.Open sql, strconn
end sub

Private Sub Form_Load()

strconn.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=mt;Initial Catalog=C:wfmnewMTDatabaseMT;user id="";password="";"
strconn.Open

End Sub

When i try to run this it shows me an error on the line: strres.Open sql, strconn

stating that there are few parameters,expected 2

i m in a fix since i don't know what can be done abou this.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Error When Connecting To Access Database
hello
i'm trying to create a program that links to a ms access database and have read the ADO tutorial but when i try to open the connection to the database and load the data from it i get this error
"Runtime error '-2147467259 (80004005)': could not find installable ISAM."
the section of the code which seems to becausing the problem is "dataconnection.open"
here is the whole section of code:

Code:
Private Sub Command1_Click()
Dim strname As String
Dim dataconnection As ADODB.Connection
Set dataconnection = New ADODB.Connection
dataconnection.ConnectionString = "provider=microsoft.jet.oledb.4.0;datasource = C:Documents and SettingsM GordonMy DocumentsSchoolcrapSoftwaredd2nd major project
ealdeal1.mdb"
dataconnection.Open
Set FullName = dataconnection.Execute("SELECT Guest Name FROM Roomdetails")
dataconnection.Close

Do Until FullName.EOF
strname = FullName.Fields.Item("Guest Name").Value
txtname.Text = strname
FullName.MoveNext
Loop
End Sub

Error In Shown Database At DataGrid
Help me pls...
I just tried to show my data base at DataGrid. The Data showed well, But there is empty data on Coloum 1 Row 1. And when i'm unload the form, there is Error message "You tried assign the Null value to a variable that is not a Variant data type"
What should i do ??
Thank You

These code on FormLoad()

cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "DatabaseKaryawan.mdb"
'set catalog
cat.ActiveConnection = cnn.ConnectionString
'buka record
cnn.CursorLocation = adUseClient
rs.Open "TabelKaryawan", cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect

Adodc1.ConnectionString = cnn.ConnectionString
Adodc1.RecordSource = "TabelKaryawan"
Adodc1.CursorType = adOpenStatic
Adodc1.Refresh

Connecting To An Access Database
hello,
i've been looking at creating a database with ado. the examples i've read about all tallk about using the ado component. but i just downloaded a ado database example and there was no ado component on the form. so i dont understand whats going on.

can you connect through a string or something.

if you can connect without using the ado component, is that a better way to program the database.

sorry if this is a simple question but i dont have a clue.

thanks

Connecting To Access Database
Hello Everyone,

I have (2) forms. Form1 And Form2 (See Below)

Form1
http://www.midstatecontracting.com/VB/Form1.jpg

Form2
http://www.midstatecontracting.com/VB/Form2.jpg

Upon loading, Form1 is filled with contact data from an access database. When the user clicks on the combo box (on Form1) next to business, Form2 is then loaded. The user can then select various information in which they would like displayed in the textbox on Form1.

So for instance if the user chose "Fax" on Form2, upon hitting the select button the label in Form1 would then change from "Business" to "Fax"

What I would like to do under the label8_change event is to connect to the database, and lookup the information with respects to label8.caption. However instead of creating multiple connections, I would like a varible in my connection. I currently have the following code under the label8_change event.

Code:

Dim Cnt As New ADODB.Connection
Dim ConName As New ADODB.Recordset

Dim ContactsVarible As Variant 'This is the varible I want to look up. ie. "Fax", "Business", "Business2" etc
ContactsVarible = Form1.Label8.Caption

'Defines ADODB Connection
Cnt.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"C:Path To File.mdb;" & _
"Persist Security Info=False"

'SQL Statement
'Below ContactsQuery.ContactsVarible is the varible I would like to look up. If the user selects "Fax" then ContactsVarible = Fax and will look up the fax number.

ConName.Open "SELECT ContactsQuery.ContactsVarible FROM ContactsQuery " & _
"WHERE ContactsQuery.CompanyName = '" & Form1.Combo1 & "' AND " & _
"ContactsQuery.FullName = '" & Form1.Combo2 & "' AND " & _
"ContactsQuery.FullState = '" & Form1.Combo3 & "' ORDER BY CompanyID ", Cnt

While Not ConName.EOF
With ConName
If (Not IsNull(!ContactsVarible)) Then
Form1.Text1.Text = ConName!ContactsVarible
Else
Form1.Text1.Text = "No " & ContactsVarible & " Availble"
End If
.MoveNext
End With
Wend

ConName.Close
End Sub


Currently running the above code results in the following run time error message. "No value given for one or more required parameters" It doesnt want to recognize ContactsVarible

Any suggestions is greatly appreciated. I hope I made this post understandable, any questions let me know.

Access Database Connecting
Can somebody give me some help in connecting to Access2000 databases and earlier Access versions. Do I need to use MS Jet 4.0 for all these? Do I use ADO or DAO?

How am I able to display the fields of a particular data table (in a separate Listbox) from a User-selected Access database name (also from a separate listbox control)?

Connecting To Access Database
I am a ASP man and trying to write a VB program to use access and then later convert it up to SQL. In ASP this is how I connect to Access or SQL..

strConnString = "driver={SQL Server};server=XXXXXXX;uid=XXXXXXX;pwd=XXXXXXX;database=XXXXXXX" '## MS SQL Server 7
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString

Then to insert all I do is call out...
strSql = "INSERT INTO Members "
strSql = strSql & "(Members_Username"
strSql = strSql & ") "
strSql = strSql & " VALUES ("
strSql = strSql & "'" & strFormUsername & "'"
strSql = strSql & ")"
my_Conn.Execute (strSql)


the problem is that it does not recognize the Server.CreateObject which I am guessing is not a VB syntax I can use, what can I use in place of that line?

Connecting To SQL Database In Access
Im making a database in access but i want it to be able to connect to a SQL database on the internet and download some data and then use it in Access. is this possible? if s how

Connecting To A Access Database Over The Net
i got a vb6 application where the user can enter information i.e. a product Name, i got an access database on the server,

what i want to do is for the user to enter in a product name in the text1 box (in the vb6 app), click search (which will connect to the server and search the products table in the access file for the product name stored in the productname field.

if the name is found the msgbox returned saying productname found else msgbox returning sayin sorry not found

Help Please

Connecting To Access Database
What is the fastest & most reliable way to connect to Access from VB.

The Access file I'm refrencing is on a network drive while the VB Program is on a local machine.

I already have ADO connections going to Oracle so maybe ODBC would be the way to go?

I'm trying to stay away from JET but I also don't want to setup 2 ODBC connections on the users machine before installing the Vb Program.

Connecting Access Database In Vb6.0
I am fairly new in VB6.0 programming. I have an Access Database called "Personnel" with the following tables, state, local/governments and NorminalRole. I know how to connect this database to vb6.0 form, so that the data displays on the form when the programm runs. Now I want

to connect to the database through VB6.0 code using sql. I also want to set recordset in code. I would prefer using ADO data control. Someone should help Please.

Connecting To A Access Database
I have vb6 and access 2000 and i have a simple database which i want to connect to on my pc though vb6 so i can make a program to update the database etc.

Connecting To An Access Database With DAO
Hi all
I have a problem.I cannot connect to an access database(.mdb format) for which a passwd has been set with the Access Front End.I am using VB and the DAO version is 3.51. Is it not possible to connect the Database having a passwd
using DAO
pls help.

Thanking u in advance

Error When Connecting To Database
I have a problem when accessing a SQL server from my VB application. Everything works fine on my test environment but when I was installing the application on the target environment I get the following error:

Error #-2147217843 Login failed for user 'UserName'.
NativeError: 18456
SQLState: 42000
Reported by: Microsoft OLE DB Provider for SQL Server
Help file:
Help Context ID: 0 :

This looks like the user doesn't have rights to the database, but what my problem is that when the same user uses the program on a different computer it works!?

I've tried to create an ODBC connection on the computer that cannot access the database and that works.

My code allows me to choose either to use ODBC or connect straight towards the database using trusted connection, no one works.

Here are my code for opening the database:

Public Function OpenDatabase() As Boolean
On Error GoTo ErrorHandler
'DebugPrint "OpenDatabase"
Set moConnect = New ADODB.Connection
moConnect.CommandTimeout = 600
If bUseODBC Then
moConnect.Open sDSN
Else
With moConnect
.Mode = adModeReadWrite
.ConnectionString = "Provider=sqloledb;server=" + sServer + "; database=" + sName + "; Trusted_Connection=yes"
.Open
.CursorLocation = adUseClient
End With
End If

OpenDatabase = True
Exit Function
ErrorHandler:
Dim objError As ADODB.Error
Dim strError As String
If Err.Number = -2147467259 Then
Resume Next
End If

If moConnect.Errors.Count > 0 Then
For Each objError In moConnect.Errors
strError = "Error #" & objError.Number & _
" " & objError.Description & vbCrLf & _
"NativeError: " & objError.NativeError & vbCrLf & _
"SQLState: " & objError.SQLState & vbCrLf & _
"Reported by: " & objError.Source & vbCrLf & _
"Help file: " & objError.HelpFile & vbCrLf & _
"Help Context ID: " & objError.HelpContext
DebugPrintError "OpenDatabase", , strError
Next
End If
DebugPrintError "OpenDatabase", Err.Number, Err.Description + " " + Err.Source
OpenDatabase = False

End Function

Error While Connecting To Database
hi
iam getting an error saying "couldn't fins installable ISAM" when i try to retrieve data using data control in the VB application. can anyone help me out with this problem?

iam using VB 6.0 and access 2000

thank you

Error In Connecting Database
Hi all,
I am facing a basic problem in my program.
I want to connecta database with VB 6.0. I have writen the codes properly.

But I am getting the following error

Run-Time error '-2147467259 (80004005):
Could not find installable ISAM.

CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Datasource = F:Rajamani_PracticeVBdbeacon
aj.mdb"

CN.Open ' ==> probleb highlighted in this line

How to solve this problem

Regards
Raj[

Error When Connecting To ADO Database
when I try and connect to this database I get the same error everytime. Invalid use of a New Key Word for the "New Connection"  How can I correct this?

 
Private Sub Form_Load()


    Dim Treespraying As Connection
    Set Treespraying = New Connection
    
Treespraying.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:My DocumentsTreeSpraying.mdb"
    
    Set adoRecordset = New Recordset
    adoRecordset.OpenRecordset "Select CustomerLastName, CustomerFirstName", Treespraying, adOpenStatic, adLockOptimistic
    
    Set txtCustomerLastName.DataSource = adoRecordset
    txtCustomerLastName.DataField = "CustomerLastName"
    Set txtCustomerFirstName.DataSource = adoRecordset
    txtCustomerFirstName.DataField = "CustomerFirstName"
        
End Sub

Urgent. VB6 App Connecting To MS Access Database
Hi,

My VB6 app reads/writes to a MSAccess Database on a network.

I've installed it onto 3 computers as an administrator, setup the database path, checked they run fine, and logged off.

When another user logs onto the computer, they can't use the program! The error says "COMDLG32 control can't be used" etc.

I've put in ServicePack4 onto each computer. And the user can't use the program, even though as an administrator I can use it.

Help please!

Chris.

Connecting Access Database To Vb Program
ive created an access database, how can i link the fields to a vb program where i can input the values in to the database?

Windows 98 Connecting To Access Database
OK I use the below coding and try to connect to database on Windows 98 it dosent work but works on XP!

Set cnn = New ADODB.Connection
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "data.mdb" & ";Persist Security Info=False"


I have tried 3.51 instead of 4.0

Connecting To A Remote Ms-access Database
hi ppl,
i'm new to this group and new to vb too.this might sound dumb, but here goes anywz.

i'v been tryin to connect to a remote Ms-Access database using the m/c's IP address. i tried using the IP address in the connection string. it ain't happening. its recognizing the m/c name though. i need to make it work with an IP address, any help will b greatly appreciated. a few examples of code will speed up things ;-)
thanx

Connecting A DataGrid To An Access Database
Hi All

Please help. I've created the following code to connect a DataGrid to an
Access database using ADO code, but the datagrid is empty at run-time? Any
suggestions?

'Add Questions to the Questions List Box
adComm.CommandText = "tblQuestions"
adComm.CommandType = adCmdTable
Set adRS.Source = adComm
adRS.Open
If Not adRS.EOF Then
adRS.MoveFirst
Set grdQuestions.DataSource = adRS
End If

Thanks

Debbie

Connecting To Access Database Trouble
I have worked my way through a Microsoft book on connecting to an Access database.
I have connected to the database, created a Data Adapter and a DataSet, all correctly. However, when i Run the program, the InitializeComponent() causes a problem. The message says "An unhandled exception of type 'System.Security.SecurityException' occurred. The InitializeComponent() statement, however, is in the Windows Form Designer generated code, which obviously ive had no input on.

This is the only code i have entered:

Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click
        DsInstructors1.Clear()
        OleDbDataAdapter1.Fill(DsInstructors1)
    End Sub

Any ideas what is going wrong??

ta,

   CharlotteR


Connecting To Access Database On NT Server
I have an ActiveX control on a web page trying to connect to an Access Database on an NT server. When I try to connect, I get an error message saying "Invalid File Path". Here's my connection string:
Code:
Dim rs as recordset
Set rs = New Recordset

rs.AciveConnection = "Provider=Microsoft.Jet.OLEDB.4.0" _
    & "Data Source=http://www.URL.com/directoryName/dbName.mdb;" _
    & "Persist Security Info="False"
 

Apparently I'm using the wrong provider (?). Can somebody please tell me the correct provider & connection string?

Thanks!


Robert
"If at first you don't succeed,
get a bigger hammer!"

Connecting Remote MS Access Database Using VB
Hi All,

Can anyone tell me how to connect to a remote MS Access Database(resides in a web server) using VB 6.0 which sits on my desktop??

Cheers,
Murty

Murty

Connecting ACCESS DATABASE ** RESOLVED**
hi all , i am having problems in establishing connection to an Access Database on my other computer from my computer can anyone help me out please. it will be a great help. thanks in advance



Edited by - Jimmy611 on 6/3/2005 4:41:14 AM

Connecting To Access 2000 Database Using ASP
I'm trying to make an asp page to connect to my password protected database(not by access). I re-used some asp code we used for a project in an access class and got the code to work. The only problem is that I have to keep the db name the same name as the project file name and couldn't change the web-site to a different sever. Obviously since this is for my work this solution won't work, as I need to put the site up on my work server.



Here is the dsn code.


Code:
'' \\\\\\\\\\ CONNECTING TO DATABASE \\\\\\ Dim Myconn,MyRS,MyField,MyRecord,DSNstr,SQLstr
        Set Myconn = server.CreateObject("adodb.connection")
        Set MyRS = server.CreateObject("adodb.recordset")
        Set MyRS2 = server.CreateObject("adodb.recordset")
        DSNstr="DSN=MIS33K-Poynor-Project01;UID=;PWD="

     Myconn.Open DSNstr

and here is some server.mappath code that I would like to use but don't know how to set up at work to have login capabilites.

Code:Dim OBJdbConnection, RsList, strProvider
' Create and open db connection
Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
' strProvider is a string containing the pathname to my database
strProvider = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
           server.mappath("/PTD/db/") & "PTD.mdb;"
' open db connection
OBJdbConnection.Open strProvider

I would prefer to use the server path connection as I can't change the dsn settings myself. How can I get the server.mappath code to work and still have login capablities?

Connecting To A Converted Access Database
Hi ,
I recently updated Office 97 to 2000. The VB application I wrote is now giving me the message "the data base version is not recognized" and I can no longer connect. The old version of the database still works fine. Any ideas? Should I create the same database in Access 2000 instead of using the converted version?

Error When Connecting To MySQL Database
HELP!!!!!!!

I am getting the following error :

Run-time error '-2147467259 (800004005)':

[mySQL][ODBC 3.51 Driver] Lost connection to MySQL server during query

This occurs when I attempt to open a connection. I connect to my local HOST and use Stunnel to encrypt the data and point to the correct database.

Has anyone else had this problem?

Thanks,

Da_Wiz

Error In Connecting To Database From Client's PC
i have a problem related to vb and sql-server connectivity.

i have developed an application thru vb and sql-server.

when i m using it frm my pc it works fine

but frm client pc it does not connect to database.
in fact i tried different server to connect from client's pc..
still same error
"SQL-Server Does Not exist or access is denied."
although when i ping the server frm client's pc i m gettin reply.

error on this line....
my connection string is
costr="Provider=SQLOLEDB.1ersist Security Info=False;User ID=sa;password=;Initial Catalog=TestCapex;Data Source=192.168.41.2"
conn.open()

this ip is in my local network
on client pc sql-server client utility is installed

wht to do..

i m very much confused
plz,plz,plz
i ll be very thankful
reply ASAP..

Ajay

Error Connecting To Oracle Database
We have developed an ActiveX Dll in VB that connecting to oracle database. It works in VB environment, but does not work when it was called by PowerBuilder code at the same machine. The error we got is "-2147221504: Oracle error occured, but error message could not be retrieved from oracle". We suspect it has something to do with TNSNAMES.ORA, initially we thought it had something to do with MDAC, after we clean up everything and just have MDAC version 2.5, we still got the same error. Any suggestions and help will be appreciated. Thanks.

Connecting Password Protected Access Database
Hi,

i know this has been asked a lot of times but i haven't found a good solution for my problem so i ask again.

I want to connect to an access database that is password protected (i set password through access menus--> tools --> security

My connection string is


Code:

Set m_cn = New adodb.Connection

With m_cn
If .State <> adStateOpen Then

.CursorLocation = adUseClient

.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source==" & App.Path & "db2.mdb;" & _
"Jet OLEDB:Database Password=banksim", _
"Admin", "banksim"

End If
End With
and i get error :

-2147217843(80040e4d) Application can't be initialized.Workgrup information file is missing or is open in exclusive mode by another user

I'm using Access 2003 database, and i haven't set a workgrup

What it's wrong here?

Connecting To An Access Database And Running Queries
Ok here is what I want to do. I have a form with 4 text boxes, each text box corresponds to a different attribute in a single table in an access 2003 database. What I want to do is when a command button is pressed the attritribute in the table is searched for a match on data that has been entered into the text boxes, but the attribute that the query looks at depends on which text box has been filled in on the form because each text box corresponds to a different attribute in the table. A match in data for that has been entered in the text box with the data in the attribute for that text box makes the matches display in a list box on the same form. From reading a few tutorials and with the help of a friend I have come up with the code below. However I need to change it so that for 1 of the text boxes 3 of the attributes need to be looked in, not just 1 attribute like the other 3 text boxes. What I also need to know if this code is correct and also which sub routine each bit of code goes under because I have got some of it muddled up.

Dim ADOCn As ADODB.Connection
Dim adoRS As ADODB.Recordset
Dim sSQL As String
Dim sWhere as string
Dim varValue as variant

ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:YourDB.mdb;"

Set ADOCn = New ADODB.Connection
ADOCn.Open ConnString

Set adoRS = New ADODB.Recordset

sSQL = "SELECT fieldname FROM tablename"
sWhere = ""
If Text1.Text <> "" THen sWhere = "fieldname1='" & Text1.Text & "'"
If Text2.Text <> "" Then
If sWhere = "" Then
sWhere = "fieldname2='" & Text2.Text & "'"
Else
sWhere = sWhere & " AND fieldname2='" & Text2.Text & "'"
End if
End If
If Text3.Text <> "" Then
If sWhere = "" Then
sWhere = "fieldname3='" & Text3.Text & "'"
Else
sWhere = sWhere & " AND fieldname3='" & Text3.Text & "'"
End if
End If
If Text4.Text <> "" Then
If sWhere = "" Then
sWhere = "fieldname4='" & Text4.Text & "'"
Else
sWhere = sWhere & " AND fieldname4='" & Text4.Text & "'"
End if
End If

If sWhere <> "" Then sSQL = sSQL & " WHERE " & sWhere

adoRS.Open sSQL, ADOCn, adOpenForwardOnly, adLockReadOnly

Do Until adoRS.EOF
varValue = adoRS.Fields("fieldname").Value
ListBoxName.AddItem varValue 'this will add data to listbox
adoRS.MoveNext
Loop

adoRS.Close
Set adoRS = Nothing
ADOCn.Close
Set ADOCn = Nothing

Thanks,
Darren

Connecting To A Password-protected Access Database From A VB5 App
Hi all,

I am trying to connect to a password-protected Access database from a VB5 app. (Yes, I know the password - I'm not trying to bring down the government.) I can connect to a databse that isn't password-protected. But once a password is introduced, I don't know how to tell the app what the password is.

I've been told that ODBC is the way to go. Is this true? If so, how do I do this step by step? Bear in mind that I need to be able to package the whole thing up into a single installation executable.

Thanks!

Connecting To Access Database And Running Queries
Hi,

I want to connect to a Access 2003 database using VB 6 and then by clicking on a command button I want to run an sql query from a specified attribute in a specified table from the Access 2003 database. The problem is there are 4 different text boxes on the form and I want a query to be run on a different attribute in the same table depending which text box has data entered into it. I want this all to run from the same command button and I want any search results from the queries to be displayed in a list box. Any help for the code for this would be appreciated. I also don't know any of the code to connect to the database. I would also appreciate it if you could tell me under what sub routines each piece of code would go under. From reading tutorials I have come up with this code and I'm sure I'm close with it:


Dim ADOCn As ADODB.Connection
Dim ConnString As String
Dim adoRS As ADODB.Recordset
Dim sSQL As String

ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:YourDB.mdb;" & _
"Persist Security Info=False"

Set ADOCn = New ADODB.Connection
ADOCn.ConnectionString = ConnString
ADOCn.Open ConnString
Set adoRS = New ADODB.Recordset
sSQL = "SELECT fieldname FROM tablename WHERE fieldname = '" & Text1.Text & "'"
adoRS.Open sSQL, ADOCn
Text2.Text = adoRS.Fields.Item("fieldname").Value
ADOCn.Close
Set ADOCn = Nothing
Set adoRS = Nothing
End Sub

Any help with fixing this code would be very helpful because I've been working on it for hours now and I'm starting to tear my hair out.

Thanks,
Darren

Connecting VB Application To MS Access Database On IIS Server(Non-DSN)
I have read and searched a lot on these forums and have not found a complete answer to my problem. I have an application where the user wants to use it over the internet. This means I have to make a remote connection to the server and the Datbase is located on a Windows 2000 IIS server(wwwroot folder). I can get it connected through an asp page and it works fine. But now as I have created this application in VB 6.0 I need it to connect it to the same location and get the data.

If anyone has similar experience in this regard please could you provide an example of code. Thanks







A VB turned PHP geek


Edited by - paCkeTroUTer on 10/20/2002 6:34:49 PM

Connecting To Password Protected Access Database
I have made a few posts on this subject and I have yet to get this feature to work.

I have an access database. It has a user account that is password protected. I know the username and password, but I don't know how to open the database using ADO in VB6. If I get rid of the password, I can open it no problem. I REALLY need to have this DB password protected.

Can anyone please tell me how, via a working example or other means, HOW to open a connection to a password protected database- Using ADO.

This is driving me crazy. I can't get it to work no matter what I try.

There has to be someone out thee who has done this and can share with me HOW they did it.

Thanks,
Josh



Edited by - JoshSommers on 10/2/2002 2:30:18 PM

Connecting Access Database By A Relative Address, Please Help
I created my final year project in VB which links to Access database, by simply pointing to the database on my hard drive, from the properity of the DAO (data1).

My problem is I have to hand my project in 8 hours, on CD therefore when the application is run off the CD it tries to look for the database on my hard drive and crashes, i've been up all night to solve the problem, but i've had no joy.

Can anybody help, please

My final year project goes out the window, if I can't sort it by 4 o'clock.

Thanks

 

Strange Error Connecting Database (ISAM)
This is very strange... The VB6 program that i'm building is interacting with an Access 2002 database. I've installed SP5, and added the references "Microsoft ActiveX Data Objects 2.7 Library" and "Microsoft DAO 3.51 Object Library". This has enabled me to pull data from the database and put it into both a ListBox and CheckBoxes successfully. The problem comes when i put in a Data Control Box and set the DatabaseName and the RecordSource. I've put the pasword for the database after the Connect option; and have tried both "Access; pwd = lemon" & "Access 2000; pwd lemon". I have also tried changing the record set type, but to no avail. The error messages that come up are either "Unrecognized databse format" or "Couldn't find installable ISAM". I've looked all over this forum as well as in the MSDN library, but can't find any examples of peoples programs that only half work like this.

Does anyone have any ideas why have of this works and half doesn't...??!!

Thanks - F

Disk Or Network Error When Connecting To Database
I am experiencing a "Disk or network error" when trying to connect to my database after the following sequence of events:

1. The user clicks a button on the main screen to open a dialog.
2. The user clicks a button in that dialog to invoke the "Save As" common dialog.
3. The user specifies the floppy drive as the location for the file (there is a disk in the drive).
4. After the common dialog closes, the user removes the floppy disk.
5. The user closes the first dialog.
6. The user clicks a button on the main screen to open the database. Disk or network error.

It is not necessary to actually save anything to the floppy drive for this problem to occur.
The software can open a text file after this sequence of events with no problem.

I am attaching a small project that reproduces this problem. Here is how to use it:

1. On the main screen, click the "Dialog" button.
2. In the dialog, click the "Save As..." button.
3. Ensure there is a disk in the floppy drive and then specify a file on that drive.
4. When the "Save As" common dialog closes, remove the disk from the drive.
5. Click the "Close" button on the first dialog.
6. On the main screen, click the "Open Database" button. You'll get the error.

Thanks in advance for any help you can offer.

Dave

Error When Connecting To Access.
Hi there,
After installing a VB program, my machine can not connect to Access any more. I declared the connection like this:

Dim con as new ADODB.Connection

but when I debug at this line of code, "con" is nothing. I don't know which dll or ocx is affected when I install the early program? Do you know this connection relate to which dll, ocx?

Thanks.

Error In Connecting To Access DB...
hi all,

i am using ADODB.Connection object to open a connection to Access Database. The database has set its password.
the problem is it gives error like this:
'The workgroup information file missing or opened exclusively by another user'
what does this mean?
please help me resolve this problem
thanx in advance

ilikevb

Error Connecting To Access 97 DB With ADO
I have a VB6 app that generally connects to a SQL Server DB, but I do need to connect to an Access97 DB on occassion to automate the retrieval of some information. On the whole, this works.

The Access data is split into 2 MDB files - one contains archive data, the other the live data - stored in the same folder on the same PC. There is no problem with users reading/updating the Access data using an old program written with Access 97.

I've created a query in the live data tables that pulls in information from the archive data, using linked tables. If I run the query in Access, then I get the required result - in other words, it runs.

When I try to open a recordset based on the query from my VB app, I get a runtime error: "-2147217911, Record(s) cannot be read; no read permission on 'TableName'". Now I have read permission - the query runs in Access - it just won't run the query from VB.

The other information you require is that I'm connecting with ADO v2.7, and using the following connection string:
Code:"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;User ID=Admin;Data Source=" & _     ACCESS_DATA_LOCATION & ";Mode=Read"
ACCESS_DATA_LOCATION is a variable that holds the path to the database.

I use the same connection string elsewhere in my VB app to read other information and it works with no trouble. The only difference is that this query refers to these linked tables. So, I suppose I need to know if it is possible to open a linked table in an Access mdb using ADO.

There is no security on the MDB files, or database passwords. I cannot merge the files together, they have to remain split. I've spent the first part of this morning tweaking the query so it now runs in a reasonable time, and the rest of it trying to find a solution to this problem on Google - with no luck.

If what I want to do is not possible - reading linked tables in an Access db using ADO - then I will have to resort to Plan B. This is telling the users to run the query in Access then type it into the VB App.




 

Connecting VB5 Data Control To Access 2002 Database
hi,
i'm work on vb 5 and am presently involved in a database project with access 2002 as backend. i have already got the front end made in vb5. But when ever i try to connect vb to the database thru data control i get an error message. request advice/help regarding this.
thanks
arsh

Connecting To Access Database Via Code / Running A Sql Statement
I am new to VB...and I am trying to add records to an access database through code.

I have a form with a datagrid and 2 datasets on it. I know I can create an add button and VB will do all the work for me, however for this particular task I would like to do it via code using sql statements.

My problem lays with trying to figure out how to execute the sql statment. I've done similar tasks in Java but the connection to a table and the execution were different and I'm not sure how to accomplish this in vb.

Is there anyone that can help me?

Thanks!

ISAM Error When Connecting To Access DB
I get the following runtime error when trying to open my database

"could not find installable ISAM"

heres my code....
help!


VB Code:
cnn.Open _       "Provider=Microsoft.Jet.OLEDB.4.0;" & _                        "Data Source=c:outputMyDB.mdb;" & _                        "Jet OLEDB:Engine Type=4;"

Run TIme Error When Connecting To Access DB
I am getting the following Run TIme Error When Connecting to an Access DB:

'Run-time Error 430 Class does not support
automation or does not support expected interface'

The application was packaged on a Windows 2000 Platform and works ok when installed on 2000 and on NT. However, when I instal it on Win98, I get this error when it tries to connect to the DB.

Any ideas ?

HHHHHHEEEEEELLLLLLLPPPP!!! Problems Connecting Access 2000 Database To Visual Basic)!
Help!!!

I'm trying to connect an Access 2000 database to a VB6 application. I've already tried installing the VB6 Service Pack 5, and I'm still receiving the following error:

Run-Time error '-2147467259 (80004005)':

Unrecognized database format <filename and path appears here>

Can anyone offer help and/or suggestions? Thanks!

Connecting To An Access Internet Database ( On A Web Server ) By A Client-side Program
Dear,

     I'm developing a client-side chatting application ( like ICQ and MSN messenger ) and my problem is that i need the chatting program to be connected to a database on a web-server and open it, then read and write from the database.

     I tried to use ADO but i got errors and it can't accept to type the location of the database as "http://...." or even "ftp://...." or even "server-name....".

     Please tell me what to do and what to use and how exactly i can make my application which will run on a Desktop computer contact the web server and open a database on it and begin search for a specified records then read and write on the database, then close the connection.

     Please provide me with sample code.

Thanks for your cooperation,

                                   Ayman.
   

Connecting To An Access Internet Database ( On A Web Server ) By A Client-side Program
Dear,

     I'm developing a client-side chatting application ( like ICQ and MSN messenger ) and my problem is that i need the chatting program to be connected to a database on a web-server and open it, then read and write from the database.

     I tried to use ADO but i got errors and it can't accept to type the location of the database as "http://...." or even "ftp://...." or even "server-name....".

     Please tell me what to do and what to use and how exactly i can make my application which will run on a Desktop computer contact the web server and open a database on it and begin search for a specified records then read and write on the database, then close the connection.

     I know that ASP can perform these funtions in case if the application is a web based, in other words if it will be handled by Internet Explorer, but in case of developing a standalone application ( like ICQ and MSN messenger ) that is developed by Visual Basic 6 we can't use ASP code, so how it can be done by ASP ?

    Please i want to be given a simple sample, or even a URL to where i can find a sample or a tutorial to this problem.


Thanks for your cooperation,

                                   Ayman.

Copyright © 2005-08 www.BigResource.com, All rights reserved