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




Using An SQL String To Call Data From Access Database Into VisualBasic DataGrid???..n


the Situtaion:.. I am using an access database that holds dates as strings. example( 06252004 ). I am trying to use an sql string to search everything that is selected from that database table, for dates specified as a start date and end date, which are specified by the user. The results should be placed on a datagrid.

All my sql attempts have failed.


Can anyone help me peice one together, in an SQL string format, that will work in VB and be accepted by access when vb passes it to it?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Sql Connection Access Database To Visualbasic Form
Hi,
I am sorta new at vb but i have manged to create my self a programe that works fine now the next step is to access certan numbers if say a text box value = 100 cc then it would get a certan number and if it =200 it would get adiffrant number now i have been reding up on sql to do this but i am not sure how visual basic and sql work to gether e.g i created a form with an ado control and a cmd button i put this under the commnad button

Private Sub Command1_Click()
create table employee
(first varchar(15),
last varchar(20),
age number(3),
address varchar(30),
city varchar(20),
state varchar(20));
End Sub

now im not sure if it can go there and then i herd form someone els it is not working because i need to access the query or somethink to tell the data base to create the table well thats what i need to no i need an e.g to do this
my databas is called karl.db .....thanx
i hope this makes scence my writing skills arent up to speed.

Puting Data Into A DataBase (VB6, ADO, ACCESS, DataGrid)
Old in basic/vb but new to this part of database with VB6.

Have created an ACESS Database with several tabels.

Have a VB6 project with several forms.
ACESS, ADO, Jet 4.0 and DataGrid.

If I make a textbox and connect it to the database and say
DataBase.Recordset.AddNew
then I can add text into that textbox and this goes into that database.
So far no problem.

But now I want a value I have in a string, TextString, to be put into the database. In fact I have several such strings I want to be put into various Fields in the new Data.

But I am not able to.

Have tryed to put this text into the TextBox. But this does not get transfered into the database. Strange to me as if I type "manually" it does.
Maybee some settings or ---
So how can I send a textstring direct to a field in the database?

Have a nice day
Per

Tutorial On Populating A DataGrid With Data From A Microsoft Access Database
can someone plz tell me how to do this or give me a link to a tutorial

i have been searching the net and this forum for ages and aint been able to find a simple tutorial that explains how to simply add data from an access database to a datagrid on my VB 6 form

HOW TO CALL ORACLE PARAMETERISED PROCEDURE FROM VISUALBASIC
HELLO,
HOW TO CALL PARAMETERISED PROCEDURE & PARAMETERISED FUNCTIONS FROM VISUAL BASIC.Please treat this is very urgent.If possible please expliain with example and also send code to me.This is more helful for me.
I'm eagerly waiting for your reply.

Bye
oviya.

Is It Possible To Call Functions In Dll File Created In VisualBasic ?
    Hi Gurus,

       I am doing Licence Mgt Sys Project. I Created one ActiveX Dll File in Visual Basic with functions like

      1. ValidateLicence(ProductCode) as Boolean
            which returns True if it is valid.

      But their apllications are based on MATLAB.
      Can MATLAB Applications call these functions in ActiveX Dlls
            If so How..?

      Please help me.....

           

How To Call Java Program From Vb And Access The Return String
Hi

I want to do this task
From a VB application I want to call a Java application passing an XML
string and which will return a string, back to VB appln.
Have u used anything like this before or do u comments some methods
which can be used in VB appln thru which we can do this.
waiting for ur reply

Regards
ravikanth

Visualbasic-l [visualbasic-l@openitx.com] Deployment Wizard Error Message
To All,

I am trying to package a project and I am getting this error:
"File must contain text."

This may sound simple, and just might be, but I have invested far toomuch time in troubleshooting.

If anyone knows the exact reason for its generation, I would greatlyappreciate it.

Maybe, exact is too strong a criteria. If anyone has a suggestion, Iwould greatly appreciate it.

I have places file names in everything that I am including in thisproject. I have opened all my ActiveX objects and made sure theirproperties were filled out, if any existed. I have done a mass searchfor filename and placed comments in front of any word that might havebeen mistaken as filename and tried to repackage and still this error.



I guess, I could go on with my testing, but I am tired of typing.

Thanks for anyone's help,



<<ole0.bmp>>


James Neal
Senior Programmer Analyst, Integrated Scheduling
CAE, USA Inc.
(813)887-1227
email@removed

How To Call Records From Ms-access Database To Msflexgrid
Dear all,
I want to call data from ms-access database to msflexgrid, thats have several record in the 1 treat no. or same criteria, but only 2 record will show in msflexgrid, the code is :
Xrow = I + 1
Data1.Recordset.FindFirst "Treatno = '" & Me.TxtTreatNo & "'"
If Data1.Recordset!treatno = TxtTreatNo.Text Then
For I = 0 To Xrow
MSFDetHT.TextMatrix(I, 0) = Data1.Recordset!productID
MSFDetHT.TextMatrix(I, 1) = Data1.Recordset!NameSpec
MSFDetHT.TextMatrix(I, 2) = Data1.Recordset!Unit
Data1.Recordset.FindNext "Treatno = '" & Me.TxtTreatNo & "'"
Next I
End If
Please help me to check the problem in the code, and I usually blank the text box with code Text1.text = "" and how to blank the masked edit box.
thanks and good day.

Exporting Data From One MS Access Database To Another MS Access Database In Visual Basic
hello friends,
i want to transfer the data from one Access database to another Access database using visual basic.

The first Access Database name is Data1
Table Name is tbldata1
fields - ID -- Number
            venueID -- Number
            Date --- Date/Time
            RNo --- Number
            SRNo --- Number
            HNo --- Number

i want to transfer this data into the second Access Database -- Data2
with table name same & fields also the same

pls can anyone help me out with this problem

Regards
Girish

How To Call Data (access) Using Combobox
hi all..i have one question..
can anyone give me the simple code how to call data from Access using combobox..

Thanks in advance

Call Data To Combobox Using SQL From Access
I would like to list out data from my table in Access into my combobox without using ADODB connection. Is it possible for me to do that ? At the moment i tried using SQL query but i could not list out the data in my ComboBox.

Below are my codes. Any advise or assistance would be very much appreciated.

Private Sub form1_load()

Dim rs As Recordset
Set rs = New Recordset
Dim StrSQL As String

StrSQL = "SELECT [ID] from test"
Set db = OpenDatabase(App.Path & "db1.MDB")
Set rs = db.OpenRecordset("SELECT * from [test]")

If Not rs.EOF And Not rs.BOF Then
rs.MoveFirst
Do While rs.EOF
Combo1.List rs!ID
Combo1.AddItem(Combo1.ListCount) = rs!test
rs.MoveNext
Loop
End If
Set rs = Nothing
End Sub

Thank you.

How Do I Install My Sql Database With VisualBasic Setup?
How do i install mySql Database with VisualBasic Setup?
How do i take backup of my database?

i've used ODBC DSN To Connect MySql with VisualBasic.

plz do help me

thanks

RE:Call Specific Record From The Database To Post It Onto The Data Report In Vb
Well, I have this prob. where I need to call a record from the database. Let say I type in the ic number of a person I want all the data of that person to appear on the report. Any idea how. Is yes, ple reply me asap. Thank in advance.

Visualbasic With Access
hi
i am just a beginner in visualbasic
i was wondering how to do this..Actually there is a print manger plus software in my office(used for managing the users print accounts in the network)..i have a datbase for the list of users..I just wanted to write a visual Basic Program so that i can access the database records,The thing is when each userlogin to windows,,say if a user named tom logsin ,it should be pointing to his particular record and display the number of pages printed by him which is in the datbase...Can anyone of u tell me how can i do this ...
thanx
ganesh

VB DataGrid And Access Database
hi,I need a code for linking VB Datagird and table or query in Access 2000 Database. pls help.

Two Datagrid Access The Same Database
I have two datagrid which access the same database but with different query command.

When i insert a data into the database the 1st datagrid list all the records just fine.
(i automatically refresh the datagrid so it can list the updated records).

But when i tried to list all the records on the 2nd datagrid, it didn't list the records at all until i close the form and reopen it again, the 2nd datagrid shows the records.

What could be the problem ?

This is my snippet codes :

Code:'This is when i clicked the command button, it will list the records on the 2nd datagrid
'ObjPerkiraan is the object from class CPerkiraan

Private Sub Cmd_Cari_Id_Perkiraan_Induk_Click()
    ObjPerkiraan.sql = "Select id_perkiraan,nama_perkiraan from master_perkiraan
    where is_Group = -1 order by id_perkiraan"
    ObjPerkiraan.dapatkanRsMasterPerkiraan
    With DG_Id_Perkiraan_Induk
        .Columns(0).Caption = "Id Perkiraan"
        .Columns(1).Caption = "Nama Perkiraan"
        .HeadFont = "Arial"
        .HeadFont.Bold = True
        .Visible = Not DG_Id_Perkiraan_Induk.Visible
    End With
End Sub

'The method from class CPerkiraan
Public Sub dapatkanRsMasterPerkiraan()
    Set rsIdPerkiraanInduk = New ADODB.Recordset
    rsIdPerkiraanInduk.CursorLocation = adUseClient
    rsIdPerkiraanInduk.Open sqlPerkiraan, con, adOpenKeyset, adLockOptimistic
    'rsIdPerkiraanInduk.Resync adAffectAllChapters
    Set FrmMasterPerkiraan.DG_Id_Perkiraan_Induk.DataSource = rsIdPerkiraanInduk
    
    FrmMasterPerkiraan.DG_Id_Perkiraan_Induk.Refresh
    'Set rsMasterPerkiraan = Nothing
End Sub
Thanks.







Edited by - erc on 3/25/2004 9:30:44 PM

Help-Use Visualbasic To Access Driver?
Hi to all. I have been reading these forums for a long time and have got a lot of answers over the past. Now I have a problem to resolve that i can't find an answer to anywhere. In visual basic can I get a handle to a driver? I have source code in C++ that uses a driver as a firewall for windows XP. It gets a pointer to the driver as such

//first of all, we have to get a pointer to IpFilterDriver Device

RtlInitUnicodeString(&filterName, DD_IPFLTRDRVR_DEVICE_NAME);

status = IoGetDeviceObjectPointer(&filterName,STANDARD_RIGHTS_ALL,

&ipFileObject, &ipDeviceObject);

//

Is there anyway to replicate this code in vb or do it some other way (it is a kernel level driver) is this possible in visual basic or do I have to further learn C to do this? Thanks for your time

How To Edit Cells In Msflexgrid With Database Method Visualbasic 6.0
Hello

How to edit cells in msflexgrid with database method By using ADO(visual basic 6.0).Could you expliain with example and also send code to me.

bye
oviya.

Database Application With Visualbasic Front End And Foxpro Backend
Hello

I want to share my vb coding expereince with new programmers.

Anybody interested in developing a database application (like invoice
program) with visual basic as front end and foxpro 2.6 as back end can
contact me for free (absolutely) sample programs source code.

Thanking you everybody

R.NATARAJAN
Join Bytes!
www.crace.net

Using A DataGrid With Coded Database Access
Hello, I have been stumped on this problem for a while.

I am need of how to correctly write the code to handle access to a database for a datagrid *without* using the ado data control itself.

I have it down pat how to connect to a database via code only for other controls, but with the grid, I get errors about bookmarks or something.

This is for a program I wish to distribute later, and so cannot have the ADO control hard coded with the location of the database.

I have tried taking an ADO control, setting up the connection string, then cut and paste that connection string to the Form Load sub, so I could change it to use app.path, but leaving the connection string blank (in the properties of the control at design time) errors out.

Any suggestions to this would be greatly appriciated! Thank you for your time.

-Greg

Datagrid Saving To A Access Database
Hello

I am using a datagrid and l would like to update and save the contents to the access database. The customer would like to have an excel style grid, that they can navigate and edit details to it, then update. And also they like to be able to add a new record and add that to the database.

I am using the data environment, as l needed to print some reports (working ok)

Code so far.


Code:
'updating
deCustomers.rsCmdCustomers.update

'saving
deCustomers.rsCmdCustomers.save



Many thanks in advance

Steve

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

Opp Access Database Table In DataGrid
Sir,

           How can I Open an Access Database Table in Datagrid when Database is password protected ?

Kunal

VisualBasic Code For Microsoft Access
It's been a while since I've had to do coding in VisualBasic, so I'm quite rusty.  However I'm using Microsoft Access to create a report of all the projects and their corresponding data (file paths, descriptions, file names, etc) that I've completed.  What I've done is create separate tables for each piece of data.  For example, I have a table devoted to what's called "Batch Point Files" for each project.  My problem is that while some jobs have over 15 batch point files, some have none.  When I run my report, Access reserves a blank line on each page for these files that don't exist for some projects.  I would basically like to be able to write a short function that will essentially hide these fields in the report if they are empty.  Something like:
    If (field(x) = null) Then
        field(x).Visible = False
    End If
I'm having trouble moving from the above pseudocode to working code that will also hide all the fields after field(x).
Any help you can offer will be very much appreciated.  If I've been unclear about what I need, I can and will provide more information.  Thank you.
Regards,
Matthew Rowles
Town of Chapel Hill
Engineering

How To Extract Data From Database To Datagrid?
pls anyone i struck here for 2days and nothing come out...

Private Sub Form_Load()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
Form3.Caption = "RCA"
startdate = CDate(Form1.DTPicker1.Value)
enddate = CDate(Form1.DTPicker2.Value)
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=false;Data Source = D:/temp/database.mdb"
Dim q
q = Chr(34)
Set rs = New ADODB.Recordset
Dim sql
sql = "SELECT Owner, [File ref] FROM [album] where [Sign Date]>=#" & startdate & "# and [Sign Date]<=#" & enddate & "# and [Owner] = " & q & "pop" & q
rs.Open sql, cn

While Not rs.EOF
Set DataGrid1.DataSource = rs.DataSource
datagrid1.datasource= rs("Owner")
rs.MoveNext
Wend
rs.Close
End Sub

it just won't work -_-"

Relations Between DataCombox And DataGrid Using Access Database
Well, my problem is basically:

I have an Access DataBase with information about schools. I built a form with 2 combobox and 1 datagrid. I can´t relationate the 2 combobox. I need:

1º - Select rows from the first combox and put only this information at the second (E.g At the first combobox (ComboCountries) I list all countries. So, when I click at the ComboCountries_click() I need to select one country and after, only the cities of that countries will appear (at the second combobox named ComboCities).

At the same time I need put in a datagrid the information of schools relationated with that 2 combox.

2º When a select one row at the datagrid, how can I create a link to another form showing the information of that selecting row?

Who can help me?

Thanks very much!

 

Datagrid, Saving And Updating To Access Database
Hello

I am using a datagrid and l would like to update and save the contents to the access database. The customer would like to have an excel style grid, that they can navigate and edit details to it, then update. And also they like to be able to add a new record and add that to the database.

I am using the data environment, as l needed to print some reports (working ok)

Code so far.

Code:'updating
deCustomers.rsCmdCustomers.update

'saving
deCustomers.rsCmdCustomers.save


Many thanks in advance

Steve

EXE Program Don't Populate Access Database Into Datagrid
Hi,
when I copy an exe file to another computer (only window2000 installed, no visual studio and no access installed), the program run but didn't populated data from Access database into the dategrid (It worked with the computer with vb and access installed). Do I need to installed some driver or component to make it work? Thanks.

Need Help With Adding Records To Access Database By Using A Datagrid
I have an Access database installed on my Windows NT4 PC.

I am accessing the database table records from a VB6 program
that I wrote. I have the "Working Model Edition" of VB6
installed on my PC.

I am displaying te contents of a user specified table with a
combination of a datagrid control and an ADO data control.
The code which loads the database table contents into the
datagrid is located in a "module" which is included
with the VB project. The display of the data works fine.

I then modified the program to add a "modification" form and
added the "appropriate" new code to the "global items module".
The modification of table records worked fine.

I then created a form and new code to handle "record additions".
The "add a new record" row is displayed at the bottom of the data
grid (i.e. a blank row with a "*"). However, when I position my
cursor into the "add a new record" row I can't type anything. I
even tried setting the ado data control mode parameter to
"adModeReadWrite" at both design time and run time. This did not
solve the problem.

Here is the code from my "global items module" which handles the
display of the datagrid.


Public Sub AddTableContents(strTableName As String)
' Display the specified table in the form "frmTableAdd"
' inside the DataGrid named "dgrAddGrid" using
' an Adodc control. This grid allows record additions.

    frmTableAdd.lblTableAdd.Caption = "Contents of table " & _
            strTableName
    frmTableAdd.adoTableAdd.CommandType = adCmdTable
    frmTableAdd.adoTableAdd.RecordSource = strTableName
    frmTableAdd.adoTableAdd.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;User ID=Admin;Data Source=F:Program FilesMicrosoft Visual StudioVB98
ewBiblio.MDB;Mode=Share Deny None"
    frmTableAdd.adoTableAdd.Mode = adModeReadWrite
    Set frmTableAdd.dgrAddGrid.DataSource = frmTableAdd.adoTableAdd
    frmTableAdd.Show vbModal

    Exit Sub

End Sub


Any ideas on what I have to change in order to be able to add new records ?

TIA for your help.

Concurrent Data Access Through A Datagrid
Hi

I try to modify a table content through a MS Datagrid in a VB Prog. The grid is "connected" to my database through an ADODC control. Several users have to fill the table in the same time.

The soft works perfectly with one user : the problem occurs when at least two users are updating the same row : I have a message stating that the record had changed, so its update is no more possible. This message also prevent me from doin' anything else on my datagrid and I must close the form to stop it.

I thought that my ADODC parameters was wrong, so I tried several combinations : adOpenStatic - adLockOptimistic, adOpenDynamic - adLockPessimistic ...

With these different combinations I had two results : with adLockPessimistic the first problem is avoided, but my datagrid doesn't record any change
and with the adLockOptimistic I face the first problem message.


This is the first time I develop a multi-user soft with ADO and I don't know how to solve these problems.

Can anyone help me ? it would be great thanks

Data Access Error In Datagrid
I have a datagrid so that if you click on a row or column it puts the data into other controls in the program. The only problem is, if theres no data in the grid, i get a data access error. What kind of if statement can i put before it gets the data to check and see if there is any data there?

The iF statement would go before this:



Code:
dgRecordView.Col = 0
txtModCompName.Text = dgRecordView.Text
dgRecordView.Col = 1
txtModProjName.Text = dgRecordView.Text
dgRecordView.Col = 2
txtModStartDate.Text = dgRecordView.Text
dgRecordView.Col = 3
txtModFinishDate.Text = dgRecordView.Text
dgRecordView.Col = 4
txtModComplete.Text = dgRecordView.Text
dgRecordView.Col = 5
txtModComments.Text = dgRecordView.Text


Thanks for all the help as always =)

DataGrid And Storing Data In Access
Sir,
I use VB6 and DataGrid with Adodc control. I’ve 3 textboxes and a CommandButton on the form. I want that all the data I feed in the textboxes should go to the DataGrid and then they be saved in the Access database. I don’t want to show the data of the database on the Grid at the opening of the form. Is it possible? Please advise. Thanks and regards.


pkb_pkb

Database Access String In Vb
Hi

I am vb.net developer. Currently i am doing some simple application in vb6. it tottaly different from vb.net. what the problem i am having right now is....i want to to connect my local Access 2000 database. What is the connection string i can use? Can anyone provide me some sample. In vb6 , do i need to import any class in order to access database?

regards.
Prisilia



Edited by - goh on 1/3/2008 7:14:45 PM

Problem On Retrieving Data From Access To Datagrid
Hai everyone, I am doing a project on Attendance Monitoring. I have two tables one master table called student and another table called att to store students daily attendance. I have four comboboxes in my form, by selecting the city,area,centre and batch the respective students satisfying this condition has to be displayed in the grid apart from that i have to display another column to mark attendance. I am using datagrid and mark P for present and A for absent. When i finished marking the whole data has to be stored in att table with the current date. The next day again the same class may be selected with the next date and has to be stored again. The problem is i am not able to store each person attendance. Please help me in this regard.

The att table contains fields like
Code:
Student_ID,Date,Attendance
The student table contains fields like
Code:
Student_ID,City,Area,Centre,Batch,Name etc
The code that i have written is like this


Code:
Public ac As New ADODB.Connection
Public ar As New ADODB.RecordSet

Private Sub Command1_Click()

Set ar = ac.Execute("select student.Student_ID,att.Attendance from student,att where City = '" & Combo1.Text _
& "' AND Area = '" & Combo2.Text & "' AND Centre = '" & Combo3.Text & "' AND Batch = " & Combo4.Text & "")
Dim count As Integer
count = ar.RecordCount
MsgBox count
Set DataGrid1.DataSource = ar

End Sub

Private Sub Form_Load()

ac.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:v-tablesStudent.mdb;Persist Security Info=False"
ac.CursorLocation = adUseClient

Combo1.AddItem ("CHENNAI")
Combo1.AddItem ("BANGALORE")
Combo2.AddItem ("GILL NAGAR")
Combo2.AddItem ("CHOOLAIMEDU")
Combo2.AddItem ("EGMORE")
Combo2.AddItem ("SOWCARPET")
Combo2.AddItem ("KOTTIVAKKAM")
Combo2.AddItem ("KILPAUK")
Combo2.AddItem ("MOGAPAIR")
Combo3.AddItem ("RANGA NURSERY")
Combo3.AddItem ("V-KIDS")
Combo4.AddItem ("1")
Combo4.AddItem ("2")

End Sub

Writing Data In A Datagrid Back Out To Access In VB6
Hello everyone.

I have a small database with less than 1000 records composed of 6 fields. I am able to display the entire database (with scrolling) in a datagrid in VB6. I am also able to modify any of the fields within the datagrid. My question is:

Is there a way to write the entire Datagrid back into the Access Database as a whole?

Any help with this would be greatly appreciated.

How Do I Send Data To Access (blank Database, Parsed Data Using Mid$())?
Need Help!!! I'm working on a project where I capture and parse reports from a unix system...I can't figure out how to send the data I extracted with MID$ to a field in Access, then on to the next record. Appreciate any help anyone can offer, I'm using VBA in Access. thorton@karpro.com

Connection String? With Access Database
I was just trying my project on the school netwrok running win 98 and the below isnt open so my program is usless is their any other connection string, I have seen some around. I THINK.

Trying to connect to Access Database

ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data " & _

Access Database Connection String
OK, since I have always used SQL Server for multi tiered projects I have never run into this problem before...
I have an application which is 3 tiers...

Client.EXE <--> BusinessObjects.DLL <--> DataObjects.DLL <--> Access.MDB

Since all my projects were in the same directory I very stupidly had the location of the database, in the DataObjects tier, as App.Path & "" & "MyDatabase.mdb"

When packaged I failed to realise that te data tier DLL was placed in System32...D'oh! And the database was placed in the Client.EXE directory...Bad Woka *SLAP*

Anyways, so I have to change my code in the Data Tier DLL so that it looks in the EXE directory for the database...but how do I find that out since the DLL has no idea which directory the user installed the application into

I am assuming the way to do it would to be query the registry and find the applications path? Since this is a slow process, relative to other VB functions, I would want to cache this...I am also assuming that if I change my Data Tier to an ActiveX EXE, then once I have the directory I can cache it in a global varible in a common module of the Data Tier so ALL threads of the ActiveX EXE can see the global vaible...?

Anyone?

Why can't the school buy SQL Server!!! Much simpler...

Woka

How To Add A Null String In A Access Database
hi,

i would like to know if we can assign a null string value (ie "") into a field of an access 97 or 2000 database ?

thank for your help

[VB6] Populating A String With Data From A Database
Hi, after some effort i've managed to connect to a JET (Access) Database using ADO in VB6, but i dont know how to store information retrieved from it in a string. I want to be able to store data from each field in the currently selected row in a predefined string.

Flat-File Database, consisting of three fields "UserID" (autonumber) "Username" (text) and "Password" (text)

Updating MS Access Table With ADO Data Control From A Datagrid
Hi,

I'm populating a datagrid with the data of a MS access table using ADO Data Control. If I change the datagrid values, its automatically updating the table contents. Is there any property of the ADO data control, so that only on setting that value, the data grid changes should be reflected in the DB & not otherwise.

regards,
narayan

Assign Data Fields From Access 2003 To A DataGrid In VB6
this question is from my Softwear engenering and Web Devlopment Teacher
________________________________________________________________________________________________________

Hello everyone
I am attempting to assign data fields from access 2003 to a dataGrid in VB6. I do not want to use the the properties wizard to assign the data, I want to do it using code. This is what I have, but the dataGrid displays blank. Col headings do display as specified. The record set is defined as such:

With rstCatPrimary
.ActiveConnection = conMMM
.CursorLocation = adUseClient
.Source = "select id, primaryCode, desc from CatPrimary"
.LockType = adLockOptimistic
.Open
End With

Set grdData.dataSource = rstCatPrimary.dataSource
With grdData
.
.
'Col Headers *******
.Columns(0).Caption = "Primary Key"
.Columns(1).Caption = "Primary Description"

'Col data assignments ****** (NEXT 2 LINES ARE THE PROBLEM)
.Columns(0).DataField = rstCatPrimary!primaryCode 'data fld = primaryCode
.Columns(1).DataField = rstCatPrimary!Desc 'data fld = desc
End With

The grid DOES populate if I use the properties wizard, so the dataset is solid

Thanks in advance

Vince

Connection String For Locked Access Database
Hi,

I have been trying to open a connection with an ACCESS database but am not able to do so.

PLZZ HELP

Convert String To Date Using Vb With Access As Database
I want to convert a string variable called, strfl to a date using vb. I am using the codes shown below. The database is msaccess. The following code throws an error when the code, 'rstDelete.MoveFirst' is executed.
Error message : "Either BOF or EOF is true........".
But there is a value for hdate in the table called holiday which is equal to "20-09-05".
So, the problem has to be with conversion of string to date which is in the part of the code, "hdate = #" & (strfl) & "#"
Can anyone please help me by showing the proper string to date conversion that works with ms access?


Code:


strfl = "20-09-05"
If strfl <> "" Then
rstDelete.Open "Select * from holiday where hdate = #" & (strfl) & "#", db, adOpenKeyset, adLockOptimistic
rstDelete.MoveFirst
While Not rstDelete.EOF
rstDelete.Delete
Wend
rstDelete.Close

Connection String For Access Database On A Network Using Ip Address
i would like to connect to an access database across a lan using the ip address of the server on which the database resides on the server as the connections string. some thing like this

data source=xxx.xxx.xxx.xxxmyfoldermydatabase.mdb

i don't seem to know how to do it right!

can any one help me?

thanks in advance

Taking String Value From Access Database And Displying It Through Combobox Value
OK - Here it goes . . . . .

I have built an application that records a persons name, address, etc. and stores it to a table in access. I then have a way that this record can be editing and the info in the rs can be read and thrown into the edit form and then resaved back to the database as an .update.

My provinces are placed in a combobox and then stored using their abbrevations like NS, NB, PE, QC, ON etc. I want to read in that value and have the form pop up with the cboProvince box displaying that value not just the default.

the variable strProvince is assigned to the value received from that particular rs.

Select Case strProvince
            Case "NS"
                intProvince = 0
            Case "NB"
                intProvince = 1
            Case "PE"
                intProvince = 2
            Case "NL"
                intProvince = 3
            Case "QC"
                intProvince = 4
            Case "ON"
                intProvince = 5
            Case "MB"
                intProvince = 6
            Case "SK"
                intProvince = 7
            Case "AB"
                intProvince = 8
            Case "BC"
               intProvince = 9
            Case "YT"
                intProvince = 10
            Case "NU"
                intProvince = 11
            Case "NT"
                intProvince = 12
        End Select
            
        '.cboProvince.ListIndex = intProvince***** I am not sure how to get this syntax written.

PLEASE HELP!!!!!!!!!!!!

:Connection String Of Password Protected Access Database
Hi what will be the connection string if i put a password to my access database?


I used this connection string:

conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "payroll.mdb;
                                     Persist Security Info=False;"

But after i put a security in my access database, i got an error whenever i login.

Run-time error '-2147217843 (80040e-4d)':
Not a valid password.


How do i fix this, please help..



Edited by - milenyume on 1/24/2006 6:21:46 PM

LOAD DATA IN A DATAGRID OR OTHER GRID VERY FAST (10763 Records) From A CD Access DB
What's the fastest form to load data in a DataGrid or other Grid ?

The System Read a DataBase from a CD the old System take only 2 seconds, my System is te New System But take 2 minutes
to load the registers in the Data Grid and is a Big Problem !!!


'Declarations
Public cnTesis As New Connection
Public cmTesis As New Command
Public recTesis As New Recordset





The Recordset is Open of this form :

cnTesis.ConnectionString = strCadenaConexion
cnTesis.CursorLocation = adUseClient
cnTesis.Open strCadenaConexion

recTesis.Source = "SELECT materia AS Materia_,cve_tesis As Tesis_,rubro As Rubro_,cve_epoca As Epoca,texto As Texto_,precedente As Precedente_,referencia AS Referencia_ from Tesis WHERE (" & strCadenaConsulta & ")"
Set recTesis.ActiveConnection = cnTesis

'This LINE TAKE 2 MINUTES In my Work this is a LOT
recTesis.Open



Other form to load the DataGrid is with de ADODB.Recordset and ADODB.Connection but the time of load is the same
in my code the part that take a lot of time is

recTesis.Open

There are a form to load a Datagrid or other king of Grid Faster ?
The older version used VB3 I can't Believe that the older aplication load the Datagrid in only 2 seconds and in the VB ver. 3 ADO didn't exist.


PLESE HELP ME !!!

Pivot Cache Connection String In Current Access Database
I created a WORKING Access database which created workbooks with multiple worksheets and pivot tables using ANOTHER Access database as the datasource. The working code is commented out below. As I said, it worked fine with that code I wanted it all to be in one db. Then I moved everything into the current database and tried to change the connection string accordingly. At this point I received this error:

"ODBC Microsoft Access Driver Login Failed"
"The database has been placed in a state by user 'Admin' on machine 'xxxxx' that prevents it from being opened ore locked."

I am not surprised by this. I probably have the connection string overly complicated, but don't know how to word it now so that it will work with the current DB. My offending code is below. The commented out stuff is what used to work fine. The new is where I attempted to make it right, but it bombs out with the above error on the last statement highlighted in red. I have tried many variations, but it shouldn't be nearly as difficult to use one of the database tables as a dat source then some external one. I have looked everywhere for how to connect to my own database or even if I have to.

Code:

--------------------------------------------------------------------------------


On Error GoTo Except
Set PTcache = xlw.PivotCaches.Add(SourceType:=xlExternal)
' PTcache.Connection = Array(Array("ODBC;DSN=MS Access Database;DBQ=D:Users501599284My DocumentsEED Actuals Reports.mdb;DefaultDir=" & _
' "D:Users501599284My Documents;D"), Array("riverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"))
PTcache.Connection = Array(Array("ODBC;DSN=MS Access Database;DBQ=" & CurrentDb.Name & ";DefaultDir=" & _
CurrentProject.Path & ";D"), Array("riverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;")) PTcache.CommandType = xlCmdSql'MUST use an Array function here if string is longer than 255 characters - Excel 2000 issue
'PTcache.CommandText = Array("SELECT GM_FW_Weekly.GeneralManager, GM_FW_Weekly.EmployeeType, GM_FW_Weekly.PandL, ", _
' "GM_FW_Weekly.Platform AS Category, GM_FW_Weekly.PlatformDetail AS Activity, GM_FW_Weekly.FunctionalManager, GM_FW_Weekly.ProgramType, GM_FW_Weekly.Pl", _
' "atformDetail, GM_FW_Weekly.SHOP_ORDER, GM_FW_Weekly.ACTIVITY_NUMBER, GM_FW_Weekly.EMPLOYEE_NAME, GM_FW_Weekly.FW, ", _
' "GM_FW_Weekly.HOUR_TYPE, GM_FW_Weekly.LaborRate, GM_FW_Weekly.Hours, ", _
' "GM_FW_Weekly.Plan, GM_FW_Weekly.PlanByFM, GM_FW_Weekly.Cost, GM_FW_Weekly.Function, GM_FW_Weekly.Heads" & Chr(13) & "" & Chr(10) & _
' "FROM `\Scgvls01psge
pis1-s2Weekly InfoDuaneEED Actuals Reports`.GM_FW_Weekly GM_FW_Weekly" & Chr(13) & "" & Chr(10) & "", _
' "WHERE GM_FW_Weekly.GeneralManager LIKE '" & GM & "' ", _
' "ORDER BY GM_FW_Weekly.GeneralManager, GM_FW_Weekly." & "", _
' "EmployeeType, GM_FW_Weekly.PandL, GM_FW_Weekly.Platform, GM_FW_Weekly.PlatformDetail, GM_FW_Weekly.FW")

PTcache.CommandText = Array("SELECT GM_FW_Weekly.GeneralManager, GM_FW_Weekly.EmployeeType, GM_FW_Weekly.PandL, ", _
"GM_FW_Weekly.Platform AS Category, GM_FW_Weekly.PlatformDetail AS Activity, GM_FW_Weekly.FunctionalManager, GM_FW_Weekly.ProgramType, GM_FW_Weekly.Pl", _
"atformDetail, GM_FW_Weekly.SHOP_ORDER, GM_FW_Weekly.ACTIVITY_NUMBER, GM_FW_Weekly.EMPLOYEE_NAME, GM_FW_Weekly.FW, ", _
"GM_FW_Weekly.HOUR_TYPE, GM_FW_Weekly.LaborRate, GM_FW_Weekly.Hours, ", _
"GM_FW_Weekly.Plan, GM_FW_Weekly.PlanByFM, GM_FW_Weekly.Cost, GM_FW_Weekly.Function, GM_FW_Weekly.Heads" & Chr(13) & "" & Chr(10) & _
"FROM GM_FW_Weekly GM_FW_Weekly" & Chr(13) & "" & Chr(10) & "", _
"WHERE GM_FW_Weekly.GeneralManager LIKE '" & GM & "' ", _
"ORDER BY GM_FW_Weekly.GeneralManager, GM_FW_Weekly." & "", _
"EmployeeType, GM_FW_Weekly.PandL, GM_FW_Weekly.Platform, GM_FW_Weekly.PlatformDetail, GM_FW_Weekly.FW")
Set pt = PTcache.CreatePivotTable(TableDestination:="", TableName:="GMPivot")

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