See Related Forum Messages: Follow the Links Below to View Complete Thread
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.
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
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
Visual Basic 6 And Access 2007
Hi Guys
I have a query regarding using VB6 and Access 2007.
We currently have an application written in VB6 that uses an Access 2003 database. We connect to the Access 2003 database using Jet, DAO and the data control in VB6. This works fine.
I now want to upgrade the application to connect to an Access 2007 database using the new Access accdb format. Can I still do this using VB6 and DAO?
I have tried a few tests and cannot get it to work. I am using VB6 with SP6. I have added the new ‘Microsoft Office 12.0 Access database engine Object library’ to my references in the application. When I try to set the ‘Record Source’ property of the data control I get the error message ‘Unrecognised database format…’. So what am I doing wrong?
Do I need an upgrade to the data control so that it can connect to the new accdb format? If so I haven’t found one in the downloads centre.
Am I using the right library?
Will VB6 talk to an Access 2007 database or do I have to use a 2003 database in the old format or upgrade to VB.Net?
Thanks for your help
John Adams
Access 2000 And Visual Basic 6
I have recently installed Access 2000 and I cannot connect the control of the database on the toolbox of Visual Basic 6 to an access 2000 database.. the error given being "Unspecified database format". I have tried looking Microsoft Website but the solutions didn't work.
Can anyone suggest what should I download and do?
Reply,
Maltesedog
Visual Basic 6.0 And Access, Help Needed!
Hi all again!
I need help, once again. I'm trying to create a very small application for personal use with Visual Basic. This is a project that I've been trying to do for like, ever. Started out in Linux with QT/C++, then Java, now Visual Basic (Since I never got mysql to run under Linux, I turned back to Windows and Access... at least for the moment).
What I have, looks like this:
http://www.geocities.com/kooltux/temp/VBOrganizer.JPG
You may need to copy the above address and paste in a new Window, since it's geocities and they make it as hard as possible to access non-index.html files.
The application is a simple game registration program. Basically, I want to put all the game that I have in a database and be able to update it and retrieve information from this application.
The database is a simple table, nothing fancy, with "Name", "Platform", "Genre", "Manufacture", "Year of Release".
As you see, it's simple. The ListBox on the left access a database, called gamedata.mdb and retrieve everything found on the "Name" columm. I have only two games there for testing purposes. What I cannot think is how to I click in a game name on the list box on the left and it shows the current "Name", "Platform", etc on the right "Each on each field".
The program is divided into two parts, one frame and one module. Here is the code for the frame:
Code:
Option Explicit
Dim rsGameData As Recordset
Private Sub btnClose_Click()
End
End Sub
Private Sub Form_Load()
Set rsGameData = dbGameInfo.OpenRecordset("gamedata", dbOpenDynaset)
Do Until rsGameData.EOF
Me.lstGames.AddItem rsGameData("Name")
rsGameData.MoveNext
Loop
End Sub
' Here is where the stuff should come....
' I know that I should use .FindNext or .FindFirst, but I dont know how...
' This is where I need help.
' I've tried to put in a If lstGamesList.Index = 0... Then ...
' but if I've over 1.000 games, it should be really tedious and
' I doubt that I could add a new game easily without changing
' the code...
Private Sub lstGames_Click()
End Sub
Private Sub mnuClose_Click()
End
End Sub
And for the module, to initialize stuff:
Code:
Public dbGameInfo As Database
Public Sub Main()
On Error GoTo MainError
Set dbGameInfo = OpenDatabase(App.Path & "gamedata.mdb")
frmVBOrganizer.Show
Exit Sub
MainError:
Error (Err)
Resume Next
End Sub
Please note, I'm reading a book about Visual Basic and this is the last lesson, using a DataBase, so go easy on me . Sorry if my english was bad or if I was not clear enough, please ask me anything if you did not understand...
Thanks in advance for the help.
P.S: here is the Access table if you need to also take a look at it:
http://www.geocities.com/kooltux/temp/database.JPG
Thanks again!
Manipulating Ms Access With Visual Basic 6
Hi.
I believe my question is the simple one. I have searched the
group and the internet for the info but none is directly relevent to my
question after 2 days
I just want to create a simple VB program with 4 buttons in which each
button will update a field of an Access Table.
I have tried using the following but i can only do AddNew but not
update:
Private Sub Form_Load()
Data1.DatabaseName = "c:AMKCarAMKCar.mdb"
Data1.RecordSource = "select * from AMKCar order by Number"
End Sub
Private Sub cmdButton1_Click()
'add a new entry to our table.
With Data1.Recordset
.AddNew
!Item1 = 1
!Item2 = 2
!Item3 = 3
.Update
End With
Data1.Refresh
End Sub
I want to update field of different records based on the different
buttons clicked. For example, if i click button1, field "Item1" will be
updated to 1. If i click button2, field "item2" will be updated to 1.
How can i do that?
About Microsoft Access And Visual Basic
i have a project which requires me to enter some data in visual basic and save into microsoft access.the saving part has no problem but whenever i close my .exe , the error below will appear. i dont really know how to do microsoft access as it is passed down to me from someone else . so can you all help me zoom in where might the error be so i can look up in books.
the .exe doest has any problem when i just open and exit , but if i add any data to it , it will has an error msg however the data will still be saved.
final is my project's name
Final has encountered a problem and needs to close. We are sorry for the inconvenience.
|