Searching MS Access From Visual Basic
Hi All
I'm just wondering if anyone could help me with searching through MS Access from Visual Basic. The user enters a search term on one form, and the next form should display a list of matches that have been found in the database. I have the basic code that connects to the database, and that works fine, but now I'm just unsure how to search that code. Any help would be MUCH appreciated.
Thanx in advance!
Becca
Public Sub Form_Load() Set MyConn = New ADODB.Connection MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:WINDOWSDesktopMusic.mdb;" MyConn.Open Set MyRecSet = MyConn.Execute("SELECT SongTitle, ArtistName From Music_Table") Do Until MyRecSet.EOF strTi = MyRecSet("SongTitle") strArt = MyRecSet("ArtistName") lstData.AddItem strTi & " " & "-" & " " & strArt MyRecSet.MoveNext Loop MyConn.Close End Sub
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Searching A Database In Visual Basic
I have been working with visual basic for a little over a year now and I have been able to design databases where you can add, update, and delete records, but I can't figure out how to search.
For example:
I am designing a program for my school which allows them to enter in vehicle information for students with the year, make, model, color, plate, etc. I want to be able to click on a Search button and have an input box pop up where they can enter in the plate number and it will display the record and if it isn't found, a message box should pop up and say "Vehicle Not Found!". I know this sounds like I'm lazy, but believe me it took me forever just to get my database working properly and now this is the only part I don't understand.
Any suggestions?
Searching A Database In Visual Basic
I've made a connection to a database like this:
Public DB As Database
Public RS As Recordset
Private Sub Form_Load()
Set DB = OpenDatabase(App.Path & "dbText.mdb")
Set RS = DB.OpenRecordset("Directory")
RS.Index = "PrimaryKey"
txtName.Text = RS.Fields("Name")
txtAddress.Text = RS.Fields("Address")
txtPhone.Text = RS.Fields("Phone")
End Sub
And I've put a Command Button for searching through this recordset:
Private Sub cmdSearch_Click()
Dim strSearch
strSearch = InputBox("What are the first few character of the license plate?")
strSearch = strSearch & "%"
RS.OpenRecordset "SELECT * FROM Directory WHERE Name LIKE '" & strSearch & "'"
End If
As sl8rz mentioned.
But when I try to search though this recordset it pops up an error message:
Run-time error '3421':
Data type conversion error.
Am I doing something wrong?
Searching For Text Is Visual Basic Modules
Is there any way to search for files that contain specific text or code in Visual Basic Modules without having to open them? We often have files that change and it would be great to be able to search for files that reference the changing file in their Visual Basic code.
Searching Date Ranges Using SQL In Visual Basic 6
Hi,
I have a question that hopefully someone can answer. I'm a bit perplexed.
I have records which have a Date/Time Field called 'CreateDateTime'. Here are some values from these fields:
02/01/2001 01:01:15 PM
02/05/2001 01:43:36 PM
01/29/2001 06:44:28 AM
I entered the following SQL query in Visual Basic where the string NurseDate1 and NurseDate2 are dates typed in by the user in the format mm/dd/yyyy. The date ranges I typed in were 02/01/2001 02/05/2001. No records were returned when there should have been two. When I typed in the range 02/01/2001 to 02/06/2001, one record (02/05/2001) was returned. I have tried several variations of the code with no success. Can anybody help me?
.SQL = "SELECT Resident.LastNameRes, Resident.FirstNameRes, Admissions.admitnum, Admissions.admitroom, Admissions.admitunit,Notes.createdatetime,Notes.updatedatetime,Notes.U serID,Employee.Department FROM Resident,Admissions,Notes,Employee where (Resident.ssnum = Admissions.ressocsec) and (notes.admitnum = admissions.admitnum) and (Employee.UserID = notes.userid) and (Notes.Createdatetime >= " & "#" & nursedate1 & "#" & ") And (Notes.Createdatetime <= " & "#" & nursedate2 & "#" & ");"
Visual Basic And Searching An Outlook Folder
Hi Everbody, been a while since my last cry for help so here it goes, I am having problems trying to search through a list of Email Items in VB6, I think the problem is to do with the Date Format, but I have tried various Syntax's including #'s, single quotes etc but I'm getting no where. Can anybody tell me how to use the Find command or Restrict command to get the first record which matches the SenderName and ReceivedTime, this is what I have got so far but just keeps reporting the error ;
Run-Time Error -2147352567
Type mismatch or the value "975116649" in the condition is not valid.
Set EItems = EFolder.Items.Find("[SenderName] = '" _
& ListViewEmails.SelectedItem.SubItems(1) & "' AND [ReceivedTime] = #" _
& ListViewEmails.SelectedItem.SubItems(3) & "#")
ListView values are :
ListViewEmails.SelectedItem.SubItems(1) = "Smith, Bob"
ListViewEmails.SelectedItem.SubItems(2) = "25/01/02 14:56:23"
Please help . . .
Work is necessary for man. Man invented the alarm clock.
How To Access Visual FoxPro Data In Visual Basic
I have a problem :(
I would like do delete a record in FoxPro data base with Visual Basic 6
I use ODBC kuhinja:
Const povezava = "Provider=MSDASQL.1; Persist Security Info=False; Data Source=kuhinja"
adott1.ConnectionString = povezava
adott2.ConnectionString = povezava
adott2.RecordSource = "SELECT sifra,grupa,naziv,nabavna,vpc " _
& "FROM izdelki "
adott2.Refresh
to view data in datagrid
I delete a record :
adott1.RecordSource = "SELECT * " _
& " FROM izdelki " _
& " WHERE sifra='" & adott2.Recordset!sifra & "'"
adott1.Refresh
Record is marked in FoxPro as deleted ( not yet PACK ) but in Visual Basic datagrid (adott2.refersh ) record is still in it.
How can i execute PACK in Visual Basic????
THX
sorry for bad english :)
What Is The Different Between Visual Basic And Visual Basic Access?
hey!
actually i'm going to do a database to track student attendance, where the student need to scan their student ID card.
which software is suitable for me? Visual basic or Visual basic access?
actually what is the different between these two?
can anyone explain to me?
Visual Basic And Access
i am trying to use visual basic for the front end interface for my access database.
i have set it up and have forms which show and can go through records of customers on a form i want another form which links a specific customer to their cars. I cannot do this and currently when i search through the form which i have made to show a customers cars it shows all of the cars in the database. how can i restrict it from doing this and thus only showing the cars which belong to that customer.
any help will be greatly appreciated.
p.s. the tables in the access database are as follows:
Customer table:
CustomerID primary key (autonumber)
name
address line 1
address line 2
address line 3
postcode
telephone
Car table:
CarID primary key(autonumber)
CustomerID foreign key(number)
make
model
year
engine size
Visual Basic + Access
In Microsoft Access 2003 i have a table which i need to lookup the values of it and insert them into a combo box on my Visual Basic program. I have tried setting up a "adodc" and it works but it doesn't display all the values that can be entered (only the one that is selected). Any help?
Sniperkid
Visual Basic And Access
i am trying to use visual basic for the front end interface for my access database.
i have set it up and have forms which show and can go through records of customers on a form i want another form which links a specific customer to their cars. I cannot do this and currently when i search through the form which i have made to show a customers cars it shows all of the cars in the database. how can i restrict it from doing this and thus only showing the cars which belong to that customer.
any help will be greatly appreciated.
p.s. the tables are as follows:
Customer table:
CustomerID primary key (autonumber)
name
address line 1
address line 2
address line 3
postcode
telephone
Car table:
CarID primary key(autonumber)
CustomerID foreign key(number)
make
model
year
engine size
Access 97 Vs Visual Basic 6
I've written several applications in Access 97 but am considering switching to VB 6. What are the advantages and disadvantages to this switch? Thanks.
Visual Basic 6/Access
In form1, I am listing customerids in a combobox,
I want to select a customerid in form1 and submit, and
in form2 I want to display info related to this specific
customerid, like contact, address, phone, fax, etc.
I am using Northwind.mdb and customers table
with visual basic 6, windows 2000. Any help please.
Thanks in advance,
Visual Basic 6.0 And MS Access
hi friends,
my problem is this.
iam trying to create a new Ms Access db from vb 6.0 using ADOX.
----------------------------------------------------Dim DBase As New ADOX.Catalog
Dim TempTable As New ADOX.Table
DBase.Create "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & GetTargetDir(srcFilePath) & "" & SelectedTableName & ".mdb" & ";"
DBase.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & GetTargetDir(srcFilePath) & "" & SelectedTableName & ".mdb" & ";"
TempTable.Name = "SFTable"
For j = 0 To srcDB.TableDefs(SelectedTableName).Fields.Count - 1
TemppFieldNameName = srcDB.TableDefs(SelectedTableName).Fields(j).Name
TempTable.Columns.Append srcDB.TableDefs(SelectedTableName).Fields(j).Name, srcDB.TableDefs(SelectedTableName).Fields(j).Type, srcDB.TableDefs(SelectedTableName).Fields(j).Size
Next j
DBase.Tables.Append TempTable
-------------------------------------------------------------------------
the above mentioned lines are the codes that iam using.
In the DBase.Tables.Append TempTable, iam getting the error that is 'invalid type'.
Because, the following code
srcDB.TableDefs(SelectedTableName).Fields(j).Type returns the integer value , which has to be coverted to the enumerated type like adInteger or adBinary like that.
My ultimate requirement is that, i just need this type conversion from the mere numeric value to the enumerated type i.e. adInteget or adBinary like that.
Please help me regarding this as iam in the damn need of this solution.
Thanks in advance
Vijay
Access XP DB In Visual Basic 6 (How)
Hi. I am new in the foum. I'm from Argentina and I'm doing a proyect in VB 6.
I have a question: How can i use Access XP DBs in VB 6 ?, because I did a DB but when i want to use that, I have a compatibility error.
I am sure that I will find the answer.
Thanks to all and sorry for my English.
Chau.
Visual Basic 6.0 And Access
Hi,
I seem to be having problems with this code below, I have a Form made using Visual Basic 6.0 and a command button, inside the command button is:
Code:
Dim AccessApp As New Access.Application
Set AccessApp = CreateObject ("Access.Application") AccessApp.OpenCurrentDatabase ("C:music.mdb") AccessApp.Visible = True AccessApp.DoCmd.OpenForm "frmmusic"
Now, what I'm trying to do is open a current database from this one command button, the database is stored on C: called music.mdb this seems to work but the problem i seem to be having is once Microsoft Access opens.. it closes straight away, any suggestions on how I can resolve this problem?
Access && Visual Basic
Hello there... I have a friend who has programmed a database in Access XP and he made all the forms and connections using it.
The question is.. Must I open an Access copy to run it and install it to the client or is there a way to use it without installing Access?
Can I translate between Access and VB?
Access && Visual Basic
Hi,
I've written a vb app. which uses Access as a database.
However I need some basic security.
I know I can have a password on a database , but I'd have to hard code the password into the app. , i'm using ADO & ODBC
i.e cn.open "Jobs" , , "Password"
Would it be possible to change a database password through code, or does anybody have any other ideas on this topic.
Thanks,
Dave
Visual Basic And Access
I have created a form in Access to take dBase III and Access tables and run queries on one field, called ZIP.
I really don't know the best way to do this. It needs to be user friendly.
I would like to open a dialog box for the user to find the file to be imported or linked.
Since we will do this several times a week, I need a generic name for the table so I won't have to change the design of my queries (like the FROM tblname) field.
Could somebody direct me in the right way.
I also need as much detail as possible since I'm new with database programming.
Thank you very much in advance!
Visual Basic In Access
Hello, i have a access db and i want to copy the contents of an excel file and paste it into a table in the db. The copy-paste procedure is prefered, because when i import the excel file into the table, the records with error concerning referentiel integerity or key fields don't come along. And if i use the copy-paste method, i get a temperary table with past errors , so i can see what the records are in the excel file, that didn't came along.
Visual Basic-access
how to recover corrupted database access (.mdb) file through visual basic code ?
Access To Visual Basic/ms Sql
Hi all,
I was hoping someone might be able to help me out with this. I'm currently moving some access database tables/forms over to ms sql/visual basic. In access i have a query name qryOpen it consists of:
CODESELECT Master.Origin FROM Master WHERE (((Master.DeliveredDate) Is Null) AND ((Master.JobID) Not Like "Canceled")) OR (((Master.JobID) Not Like "Canceled") AND ((Master.ShipNum) Is Null)) GROUP BY Master.Origin ORDER BY Master.Origin;
Visual Basic 6 <--> Access
I'm reading/writing from Access using both EXECUTE() and Recordset methods.
I get weird errors though. For example I have 5 text boxes bound to fields.
I will change the data in a couple of the text boxes then immediately try to
do a INSERT to add another record. This returns errors like, "operation not
allowed in this context".
Is it possible to force the database to check the value of bound fields, and
immediately write them to the datasource fields in the database?
Adrian
Visual Basic And MS Access
hi friends,
my problem is this.
iam trying to create a new Ms Access db from vb 6.0 using ADOX.
----------------------------------------------------
Dim DBase As New ADOX.Catalog
Dim TempTable As New ADOX.Table
DBase.Create "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & GetTargetDir(srcFilePath) & "" & SelectedTableName & ".mdb" & ";"
DBase.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & GetTargetDir(srcFilePath) & "" & SelectedTableName & ".mdb" & ";"
TempTable.Name = "SFTable"
For j = 0 To srcDB.TableDefs(SelectedTableName).Fields.Count - 1
TemppFieldNameName = srcDB.TableDefs(SelectedTableName).Fields(j).Name
TempTable.Columns.Append srcDB.TableDefs(SelectedTableName).Fields(j).Name, srcDB.TableDefs(SelectedTableName).Fields(j).Type, srcDB.TableDefs(SelectedTableName).Fields(j).Size
Next j
DBase.Tables.Append TempTable
-------------------------------------------------------------------------
the above mentioned lines are the codes that iam using.
In the DBase.Tables.Append TempTable, iam getting the error that is 'invalid type'.
Because, the following code
srcDB.TableDefs(SelectedTableName).Fields(j).Type returns the integer value , which has to be coverted to the enumerated type like adInteger or adBinary like that.
My ultimate requirement is that, i just need this type conversion from the mere numeric value to the enumerated type i.e. adInteget or adBinary like that.
Please help me regarding this as iam in the damn need of this solution.
Thanks in advance
Vijay
Visual Basic And MS Access
hi friends,
my problem is this.
iam trying to create a new Ms Access db from vb 6.0 using ADOX.
----------------------------------------------------Dim DBase As New ADOX.Catalog
Dim TempTable As New ADOX.Table
DBase.Create "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & GetTargetDir(srcFilePath) & "" & SelectedTableName & ".mdb" & ";"
DBase.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & GetTargetDir(srcFilePath) & "" & SelectedTableName & ".mdb" & ";"
TempTable.Name = "SFTable"
For j = 0 To srcDB.TableDefs(SelectedTableName).Fields.Count - 1
TemppFieldNameName = srcDB.TableDefs(SelectedTableName).Fields(j).Name
TempTable.Columns.Append srcDB.TableDefs(SelectedTableName).Fields(j).Name, srcDB.TableDefs(SelectedTableName).Fields(j).Type, srcDB.TableDefs(SelectedTableName).Fields(j).Size
Next j
DBase.Tables.Append TempTable
-------------------------------------------------------------------------
the above mentioned lines are the codes that iam using.
In the DBase.Tables.Append TempTable, iam getting the error that is 'invalid type'.
Because, the following code
srcDB.TableDefs(SelectedTableName).Fields(j).Type returns the integer value , which has to be coverted to the enumerated type like adInteger or adBinary like that.
My ultimate requirement is that, i just need this type conversion from the mere numeric value to the enumerated type i.e. adInteget or adBinary like that.
Please help me regarding this as iam in the **** need of this solution.
Thanks in advance
Vijay
Access && Visual Basic
I have 2 tables one is an existing table with names and addresses in it, the second table has city, state, zip and county in it, I would like to enter the county code in my first table based on the zip code in both, is this possible and if it is please give me and idea of how to do it!
Thanks, Gabby
Visual Basic/ MS Access
Can anyone help?? I need to get a User to click a buton which will delete all
records in a DataGrid through a VB front. Please help, very urgent??
Access INI File Using Visual Basic Net
Hi All,
I have a problem with Visual Basic net. I tried this code in VB 6. It work without any problem. But with VB net ... It returns me empty .
Code:
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias _
"GetPrivateProfileStringA" (ByVal lpApplicationName As String, _
ByVal lpKeyName As String, ByVal lpDefault As String, _
ByVal lpReturnedString As String, ByVal nSize As Long, _
ByVal lpFileName As String) As Long
Public Function GetUrlFromLink(ByVal sFilename As String, ByVal SectionNAme As String _
, ByVal Keyname As String) As String
Const BUFSIZE = 1024&
Dim lRet As Long
Dim sBuf As String
sBuf = Str(BUFSIZE + 2)
lRet = GetPrivateProfileString(SectionNAme, Keyname, _
"", sBuf, BUFSIZE, sFilename)
If lRet > 0& Then
GetUrlFromLink = Left$(sBuf, lRet)
End If
End Function
In Main Form
Code:
pathUpdate = GetUrlFromLink("c:client.ini", "online", "dddd")
MsgBox(pathUpdate)
The client.ini file ;
[online]
dddd=999
Could I make some configuration or changes for VB net ?
Visual Basic Error Cant Access Db
Im Using Vb6, Access 2000 Db, My Puter At Work Has Windows 98. And There, It Runs Very Well.
But At Home I Have Windows Xp ,home Edition, And Every Time I Try To Run The Application, It Shows An Error Message, That Says, "could'nt Find Installable Isam"
. It Still Show Me The Forms , But Could'nt Access The Data Base.
What Can Be Wrong Here?
However, If I Try Running A Form Using Access 2000, Using Vba, It Runs Well.
Calling Access From Visual Basic
I am attempting to call an Access module from a visual basic script. I have go into the Access database using
Sub SaveReportLocation
Dim l_conn_str, conn, l_update_string, oCommand, sConnectionString
l_conn_str = "DSN=email_reports;"
Set conn = Wscript.CreateObject("adodb.connection")
conn.Open l_conn_str
'
l_update_string = "UPDATE [report_email_details] SET [report_email_details].source_directory = '" & l_dest_fldr & "'" & " WHERE active = Yes"
conn.Execute l_update_string
'
conn.Close
Set conn = Nothing
to indicate where the output files are. I need to Email these to a list of recipients. I have created an Access application that reads a table and uses the following to Email:
Code:
Option Compare Database
Option Explicit
Dim db As Database
Dim LiveRecipients As Recordset
Dim objOlApp As Object ' MS Outlook object variables & strings
Dim strUser As String
Dim objNS As NameSpace ' used to ensure email doesn't crash when user has Exchange not Outlook
Dim objRecipient As Object
Dim objItem As Object
Set db = CurrentDb
Set LiveRecipients = db.OpenRecordset("report_email_details Query", dbOpenDynaset)
Set objOlApp = CreateObject("Outlook.Application")
Set objItem = objOlApp.CreateItem(olMailItem)
Set objNS = objOlApp.GetNamespace("Mapi") ' used to ensure email
strUser = objNS.CurrentUser ' doesn't crash when user has Exchange not Outlook
LiveRecipients.MoveFirst
Do Until LiveRecipients.EOF
Set objRecipient = objItem.Recipients.Add(LiveRecipients!email_address)
objItem.Subject = LiveRecipients!report_name
objItem.Body = "Please find attached report" & vbCr & vbCr
objItem.Attachments.Add (LiveRecipients!source_directory)
objItem.Send
LiveRecipients.MoveNext
Set objItem = objOlApp.CreateItem(olMailItem)
Loop
Set objItem = Nothing
How do I string them together. That is how do I call the above code from Visual Basic.
Robert
Compacting Access Db From Visual Basic
Hi,
I have developed a vb desktop application using VB 6.0 and Ms Access 2000 as backend. But when i had to deploy it to the client i had to make it compatible to run with Ms Access 97. So before sending the db to the client i convert it to access 97 manually (Tools -> Database Utilities -> Convert database).
I have added the following code to the app to compact the database programatically since i have 1 temp table to which i often dump bulk data and delete the same as per the requirement to the app. And this causes in increase in the size of the db. But the problem i am facing is after compacting the db, the db which originally in access 97 format, gets converted to access 2000, which is not desirable. Pls help me ...............
The msjro.dll on my machine is of 2.5 version
Public Function CompactDB() As Boolean
'On Error GoTo errfunc1
'Varible declaration
Dim JRO As JetEngine
Dim oFS As Scripting.FileSystemObject
Dim dbCmpct As String
Dim dbDestn As String
Dim strSource As String
Dim strDestn As String
'Set Object Declarations
Set JRO = New JetEngine
Set oFS = New Scripting.FileSystemObject
'Set Compact Database Path
dbDestn = App.Path & "1ZMappings.mdb"
dbCmpct = App.Path & " est.mdb"
'Set Destination and Compact Database
strSource = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbDestn
strDestn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbCmpct
'Check if Compact database exists
If Dir(dbCmpct) <> "" Then Kill dbCmpct
' This statement creates a compact version of the
JRO.CompactDatabase strSource, strDestn
'Kill the destination database
Kill dbDestn
'Rename the Compacted Database to Destination Database
oFS.MoveFile dbCmpct, dbDestn
'Destroy the objects
Set JRO = Nothing
Set oFS = Nothing
CompactDB = True
errfunc1:
'=======
If Err.Number <> 0 Then
WriteErr_Log "The database is open exclusively by another user. Please close the applicaiton and try again.", Err.Number, Err.Description
MsgBox "The database is open exclusively by another user." & vbCrLf & " Please close the applicaiton and try again.", , "Error!"
Screen.MousePointer = vbNormal
CompactDB = False
Exit Function
End If
End Function
Access Forms In Visual Basic?
Is it possible to have an access form with the exact background in Visual Basic instead of the same dull gray background provided?
Thanks,
Stephen
Access Reports In Visual Basic
I'm trying to open an access report in Visual Basic.
Please I need some help! Please some help for the newbie.
I've got the following code in a standard .exe program:
Code:
Dim appAccess As Access.Application
Set appAccess = New Access.Application
appAccess.OpenCurrentDatabase "c:Documents and SettingsStephen LeCompteMy Documentsdisp-1.mdb"
appAccess.DoCmd.OpenReport "myReport", acPreview, , "myOptionalCondition"
appAccess.Quit
Set appAccess = Nothing
I've got under Project / References / Microsoft Office 9.0 Object Library a check mark!
But when I run the program it doesn't work. The error that keeps coming up Compile error: Invalid outside procedure highlighted at the Set command above. All that I have done I have down exactly the above nothing more. Please help me, please, please, please.
Thanks
Stephen
Word, Access And Visual Basic
Hello everyone.
I am having a ver hard time trying to do the following:
I have 10 databases in access. Two of them are linked to corresponding word documents. So far, so good. But here is when the problem kicks in.. I've done everything in Access and no one else in the office has Access. therefore, I need to have my databases set-up in such a way so that I can save them and use word templates instead. But I don't know how to start. I tried creating an access webpage. But I have two problems:
1) How do I add new records to the databases?
2) How do I transfer this data to a word template or document?
If someone can shed some light, please....
Thanks
Connecting Access Using Visual Basic!
i am looking for a simple example of connecting microsoft access 2000/xp, with simple code like selec,delete create table with this database al from visual basic
thnaks in advace
peleg
Access To A Web Page From Visual Basic
so I need a visual basic application that will collect log in data from data sheet, log in to a website, navigate to the correct page, collect additional data from data sheet, enter the data in the page(form), collect the returned data and store it with other input return data.
is there any way that i can do this..?
i am very good at vb i also know about the message format of the html protocol.
can any one help me in this ?
VisualFoxPro And Access Or Visual Basic
i have visualfox pro table and i want to connect to him. For read, not problem. But for write there is the problem
i read on microsoft web site only RDO connection can write in foxpro table
http://support.microsoft.com/default...NoWebContent=1
i try that
add "Microsoft remote Data Object 2.0" in reference and that
-----------------------------------------
Private Sub Form_Load()
'
' Using a DSN-less connection to open a free table
'
cn.Connect = "SourceType=DBF;" _
& "SourceDB=C:VfpSamplesData;" _
& "Driver={Microsoft Visual FoxPro Driver}"
cn.CursorDriver = rdUseOdbc
cn.EstablishConnection "rdDriverNoPrompt"
SQL = "select * from customer" 'this should be a free table
Set rs = cn.OpenResultset(SQL, rdOpenKeyset, rdConcurRowVer)
rs.MoveFirst
Text1.Text = rs(0)
Text2.Text = rs(1)
End Sub
------------------------------------------
but that doesn't work i receive :
Run-time error '429':
ActiveX compoment can't create object
i try register again ... nothing (regsvr32 msrdo20.dll) and reboot after
i try VB6CLI.exe ..... nothing
http://support.microsoft.com/default...b;EN-US;194751
Please help me !!!
Tutorial On Access/Visual Basic
I'm looking for a good tutorial site to learn visual basic with access from the ground. I took visual basic when i was a senior in high school 2 years ago. I forgot what I learned there. Haven't used visual Basic since that. I'm a web designer and webmaster of http://mvpleague.net. I have skills on php/mysql.
I'm looking for a good book to teach me access/visual basic from the beginning. I tried to searching some post in here and couldn't find one to help me.
Access 2000 And Visual Basic
I installed the sp5 for me to be able to use Access 2000 with Visual Basic, but I still get unrecognizable database when clicking on Recordset in the properties.
Any suggestions would be greatly appreciated.
Access Database <-- SQL --> Visual Basic
Hi....
I have written a small application that searches and update information from an access-database using SQL-Queries.
The database contains among other tings a field with "Date" in the Access date format (2002-02-13) for example. I wonder what datatypes i can use in my VB-program to compare this with for example todays date. For example, I want to search for any post older than 3-Months. I know how the SQL-Query should look but not witch formats to use.
//Martin
Access Database Using Visual Basic
I have done a programme using visual basic to access database. Its on searching for phone numbers Using First Name and Last Name or both. But now i've to improve on the search using initials. For Example, my first name is feroz and last name is Khan. the search should be done by entering F Or FK. Please Send me the code As soon as possible. Your help is appreciated. Thank You.
Visual Basic With MS Access Image
Hi,
what is the best component to use when you want to display an image in Visual basic if made used of an MS Access database to store the image? I have made use of the OLE component with the following code in order to upload the picture to the OLE component - but it does not want to show the image:
ON Error GoTo ET
strfilepath <> GetFile(Me)
If strfilepath <> "" Then
OLE1.SourceItem = LoadPicture(strfilepath)
End if
Exit Sub
ET:
Exit sub
End Sub
The idea is that when the user click on a button to add new record, he must complete all the fields - then when he get to final field where he must upload his picture, he must click on a button, search for his picture, upload and then click on update in order to write everything to a MS Access database.
Access And Visual Basic Link
I am currently doing an A2 computing project where i need to create a databse, and then make a font end for it in visual basic and also have some code do a few calculaions e.t.c.
Currently i have created the databse and and have gone about linking it to visual basic using ADO. I have created a connection but am now having problems with accessing all my records from my tables?
can someone please tell me how i can use, edit and add values to my databse using this method?
Also, is there any easier way i can complete this project or is this the best way??
Thanks
Visual Basic 6 From Excel To Access
I've been totally cracking my head on this one.
What I want to do is select one cell from an excel sheet and put it into a table on access database.
What I got is this, the only problem is I cant select a cell or a range of cells even.
Code:
mDataBase.Execute "Select into [;database=" & mAccessFile & "]." & mTableName & _
" FROM [" & mWorkSheet & "$]"
If I dont use select or specfically select the column name I just get errors if I try to specify A1 or B1 etc etc.
Code:
Private Sub Command1_Click()
On Error GoTo errHandler
Dim mExcelFile As String
Dim mAccessFile As String
Dim mWorkSheet As String
Dim mTableName As String
Dim mDataBase As Database
mExcelFile = App.Path & "Book1.xls"
'mAccessFile = App.Path & "Staging tables.mdb"
mAccessFile = App.Path & "Db1.mdb"
'mExcelFile = App.Path & "Macris CRRS for Accenture Dev1.xls"
mWorkSheet = "Sheet1"
mTableName = "Table1"
' Below you may use "Excel 7.0" or 8.0 depending on your installable ISAM.
Set mDataBase = OpenDatabase(mExcelFile, True, False, "Excel 5.0")
mDataBase.Execute "Select * into [;database=" & mAccessFile & "]." & mTableName & _
" FROM [" & mWorkSheet & "$]"
MsgBox "Done. Use Access to view " & mTableName
Exit Sub
Really really appreciate it if someone could help me on this area.
Or can this not specify a range ???
Crystal 8.5 Via Visual Basic And Access
I am having a hard time connecting an Crystal reports (ODBC connected to the Access Database) through VB. I always get the error "Cannot Open SQL Server".
Please advise, this is driving me crazy:
See code below;
With Cry
.ReportFileName = sCryPath & "" & lCry.List(iCry)
.Connect = sHiport
.DiscardSavedData = True
.RetrieveDataFiles
.ReportSource = 0
.Destination = crptToWindow
.PrintFileType = crptCrystal
.WindowState = crptMaximized
.ReportTitle = lCry.List(iCry)
.WindowMaxButton = False
.WindowMinButton = False
.Action = 1
If .PrintReport > 0 Then
MsgBox .LastErrorNumber & ": " & .LastErrorString, vbCritical, "Please Contact your Local Administrator"
Exit Sub
End If
End With
|