MySQL & FindFirst

May 9, 2005

Hello,
I hope I have posted this to the correct forum?
Anyways, I have started porting my database backend to MySQL after a spate of corruptions and speed degrading daily, I have managed to get most things functional but one thing which I can not get working is an odd thing with the FindFirst statement.
I have the following line of code...

rst2.FindFirst "AwaitingStock=True and StockIn=False and DOA=False and Model='" & Trim(Me.Model) & "'"

which works find with Access backend but with MySQL I get the error...

Run-time error '3761':
The decimal field's precision is too small to accept the numeric you attempted to add.

This is obviously not the correct error as I am not trying to add anything!
If I remove the bit about the Model, the code executes fine, also, if I remove all the =True parts and just leave the Model part everything works fine so I guess it is because I am mixing string and integer fields in the search???

Any help greatly appreciated.


Kind regards,


Tom Findlay

View Replies


ADVERTISEMENT

Listbox FindFirst

May 1, 2006

When, id do press the 'RecordWeergeven' button, Microsoft Visual Basic returns with a error. Method or data member not found. I think the error is located bij Me.Keuzelijst0. Do i have to declare a Listbox or create a second recordset. Please help.

Private Sub RecordWeergeven_Click()
'Me.RecordsetClone.Findfirst "[ID] = " & Me.lstList.ItemData(lstList.ListIndex)
'Me.Bookmark = Me.RecordsetClone.Bookmark
Dim rst As ADODB.Recordset
Set rst = Forms![FMR_users].RecordsetClone
rst.FindFirst "usr_id=" & Me.Keuzelijst0 & ""
Forms![FMR_users].Bookmark = rst.Bookmark
DoCmd.Close acForm, "GaNaarRecord"
End Sub

View 3 Replies View Related

Syntax Help On Rs.findfirst

Mar 25, 2008

Hi, I need some syntax help on the following line of code:

rs.FindFirst (rs![NewRecord] = True And IsNull(rs![Event_No]))

where NewRecord is type boolean and Event_No is string. Ive used this function mainly on strings so am not sure what to do with this one!
thanks!!

View 2 Replies View Related

Rst.FindFirst Problem

Mar 2, 2005

Hello All

I just discovered the reason why my table has not been working the way I want it to. In my code below, I have set my rst to find the first record of the previous month which in itself is correct, however I just discovered that it is picking up the records in ascending order.

Here is my code:
Option Compare Database
Option Explicit

Private Sub Button5_Click()

Dim prevMonth As Integer
Dim curMonth As Integer
Dim prevYear As Integer
Dim curYear As Integer
Dim CurRecordMonth As Integer
Dim rst As Recordset
Dim rst2 As Recordset
Dim db As Database
Dim monthText As Variant

Set db = CurrentDb

'fill an array with the text for months names
monthText = Array("", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")

' find previous and current Year and month. If current month = jan then go back to Dec of the year before
curMonth = Month(Date)
curYear = Year(Date)
prevYear = Year(Date)
prevMonth = Month(Date) - 1

If prevMonth = 0 Then
prevMonth = 12
prevYear = prevYear - 1
End If

' count number of existing records for current year and month
' If DCount("Month", "TTransactions", "month = '" & monthText(curMonth) & "' and year = " & curYear) = 0 Then

If DCount("Month", "tTransactions", "month = " & curMonth & " and year = " & curYear) < 2 Then
'if current month and year does not exist in table
' open table and find last months record
Set rst = db.OpenRecordset("tTransactions", dbOpenDynaset)
rst.FindFirst "month = " & prevMonth & " and year = " & prevYear
' open table again to write a new record
Set rst2 = db.OpenRecordset("tTransactions", dbOpenDynaset)
Do Until rst.NoMatch ' loop through all records meeting the criteria
rst2.AddNew
rst2![TelNo] = rst![TelNo]
rst2!Year = curYear
rst2!Month = curMonth
rst2!Rental = rst!Rental
rst2![Fees] = rst![Fees]
rst2![Vat] = rst![Vat]
rst2.Update
rst.FindNext "month = " & prevMonth & " and year = " & prevYear
Loop
rst.Close
rst2.Close
Set rst = Nothing
Set rst2 = Nothing
End If
Set db = Nothing

End Sub

Function CallButton5()

Call Button5_Click

End Function


I have put in an autonumber to assign sequential numbers to the records as they are entered. This I had hoped would allow me to sort my query by autonumber, however if the findfirst keeps finding the records in ascending order then I'm lost. Is there any way to get round this?

Thank you Kindly

View 3 Replies View Related

Using The FindFirst Method With DAO

Aug 1, 2005

I am writing an event procedure to check to see if a particular Project number exist in a recordset. I am trying to use the findfirst method and are having some problems. Here is my code.

Private Sub Command3_Click()

Dim db As DAO.Database
Dim rs As DAO.Recordset, ProjectNo As String, SqlStr As String, StrProjectNo As String


Set db = CurrentDb()
Set rs = db.OpenRecordset("tblTrackingSheetFrm", dbOpenTable)
StrProjectNo = Me![ProjectNumber]
rs.FindFirst StrProjectNo

If rs.NoMatch Then
Forms![frmProjectCriteria].Visible = False
DoCmd.SetWarnings WarningsOff
DoCmd.OpenQuery "(1)qryDeletetblTrackingSheetFrm"
DoCmd.OpenQuery "(1A)qryDeletetblTrackingSheetTMP"
DoCmd.OpenQuery "(2)qryAppendProjectTasks"
DoCmd.OpenQuery "(3)qryMaketblLaborActuals"
DoCmd.OpenQuery "(3A)qryUpdatetblTrackingSheetTMP"
DoCmd.OpenQuery "(4)qryDeletetblMaterialActualsTMP"
DoCmd.OpenQuery "(5)qryAppendEquipment"
DoCmd.OpenQuery "(6)qryAppendInventory"
DoCmd.OpenQuery "(7)qryAppendPayables"
DoCmd.OpenQuery "(8)qryAppendPurchaseOrder"
DoCmd.OpenQuery "(9)qryUpdateMaterialActuals"
DoCmd.OpenQuery "(A)qryAppendtblTrackingSheetFrm"

DoCmd.SetWarnings WarningsOn
DoCmd.OpenForm "frmTrackingSheet", acNormal

Else

MsgBox " Project worksheet already opened by another user."

rs.Close
End If
End Sub

What this does is check to see if another user has a project open and if so doesnt allow that user to access that project. I am getting the following error when I execute the procedure on the findfirst Code line.

Runtime error 3251 Operation is not supported by this object type.
Can someone take a look and see what I am doing wrong.
Any help is greatly appreciated.

View 2 Replies View Related

Recordset - FindFirst Issues

Feb 23, 2005

Hello,

I have a procedure that searches a table (recordset 1) for values in a lookup table (recordset 2) using FindFirst / FindNext. The routine worked fine until recently, I now have two issues;

I have included a new country in the lookup table - Cote D'Ivoire, now I get an error message when it reaches this name. I guess it's the " ' " that is causing the problem but don't know how to get round it!!??

I have modified the program so I can select the field I want to search from a form (thanks John) but it won't accept the field name as it's not part of the recordset e.g. rstTempTable.findfirst "[Field] = etc. How can I pass the chosen field from the form to the recordset?


Thanks in advance .....

View 4 Replies View Related

Bookmarking Recordsets FindFirst

Sep 27, 2005

Need a little help with a record selector.
I ask it to find a record and bookmark it. No problem.
If record doesnt exist I get the value from a control and run a Insert Into command into my table creating a new record with that case #.

Now how do I modify the code below to make the new record just inserted into the bookmarked record. See sample code below. I'm not too practiced when it comes to this recordset business.

Any help is appreciated



Private Sub FindTheRecord()
' Find the record that matches the control.
Dim rs As Object
Dim Answer As String
Dim aSQL As String

Set rs = Me.Recordset.Clone
rs.FindFirst "[CaseNo] = " & Str(Nz(Me![CaseNo]))
If rs.NoMatch Then
Answer = MsgBox("No Matching Case Number Found." & vbCrLf & "Would you like to start a new" & vbCrLf & "record using this case number?", vbYesNo)
If Answer = 6 Then
DoCmd.SetWarnings False
aSQL = "Insert Into Main ([CaseNo])Values ([Forms]![frmMain]![CaseNo]);"
DoCmd.RunSQL aSQL
DoCmd.SetWarnings True

DoCmd.GoToRecord acDataForm, "frmMain", acLast
Code: Original - Code ' does not recognize the last record just added to the table, is there a command I can use here? ' does not recognize the last record just added to the table, is there a command I can use here?

Else
MsgBox "Action Cancelled"
CaseNum = ""
CaseNumYear = ""
DoCmd.GoToControl "CaseNum"
End If
Else
Me.Bookmark = rs.Bookmark
Call EnableControls
End If
End Sub

View 3 Replies View Related

Queries :: Proper Syntax For FindFirst Method

Nov 15, 2013

I can't seem to figure out the proper syntax for the FindFirst method. I am using several variations of this effort:

Dim dbs As dao.Database
Dim rst As dao.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblInvoice", dbOpenDynaset)
rst.FindFirst "rst!ID = frmInvoice!txtID"

I get an error message that says that Access doesn't recognize rst.ID as a valid field. But, it most certainly is. I tried substituting tblInvoice but got the same error.

View 3 Replies View Related

Forms :: Locate A Record On Multirecord Form By Using Findfirst Method

Mar 8, 2014

I am trying to locate a record on a multirecord form by using Findfirst method. Here is the code.

Dim UA1 As String, UAE1 As String, UA2 As String, UAE2 As String, UA3 As String, UAE3 As String, apost as string, repl as string
apost = "'"
repl = "''"
UA1 = Nz(Forms(ParName).Form.NAME, " ")
UAE1 = Replace(UA1, apost, repl)

[Code] ....

This code sometimes works and sometimes it does not work. The field CNO is a text field of 5 characters but contains the card numbers that is numeric data or nothing.

View 2 Replies View Related

Looking Into MySql

Oct 28, 2005

I am just a guy in a cube that likes Access and have been able to make it do some great things but am by no means a programmer so...
It seems like the next step is to go with a SQL be and Access fe (network not internet applications) not that what I have isn't doing the job, I just want to swim with the other fish and not be left behind.
So if I could just download a program called SQL that would be great but there are various kinds? SQL Server, MySQL and who knows what else.
I don't know what my company will migrate to in the future (we are currently using A97 and upgrading to 03 soon) and most people here don't even know what a database is. I thought I'd give MySql 5.0 a look, dowloaded it and installed it (don't even know if I answered all the install questions correctly) and started it up and I felt like I was looking at a WordPerfect 5.1 screen all over again (blank blue screen and that was it for those who do not remember). All I saw was a command prompt with "mysql>" that's it.
Now I don't mind doing my reading but I'd just like to know I am going in the right direction before I spend all this time only to find out I should have gone another way.
Is there an easy start method or do I just have to bump and feel my way through all this?
It seems once you leave the calm cool shallow waters of Access you are suddenly faced with strange deep sea creatures called "Programmers".

View 12 Replies View Related

MySQL Amd Access

Feb 7, 2006

I am building my frist database with MySQL as a backend to Access. I am using the ODBC driver and it looks very interesting. I have a question already though. I know that I can use the InnoDB engine and create relationships within MYSQL to enfro referential integirty, but should I? Or should I create the relationships in Access and let Access do the enforcing? Will my Access application report MySQL errors?

Thanks for the time.

View 2 Replies View Related

Mysql Access

Mar 13, 2006

I have a mysql database on my website (remote db). And i want to link to this database in acess(local bd) so that i can manipulate data.

How is it possible

View 1 Replies View Related

Access V.S. MySQL

Apr 22, 2006

Hey, Just wanted to throw the question out there, I already asked another member on their opinion on this but havent heard anything back yet, so im going to also throw the quesation out here as well and see what i get. Im new to databases and started out trying to learn Access with the intention that what i learned in Access i could use to learn MySQL, I figured access was a easier starting point to get my feet wet. I eventaully want to apply my databases to the web and im not sure but just wanted to find out. Does access have capabilities to manage a site where customers create an account on the site and log in and everything?? I was thinking access cant really do it and if it could it might be hard, so thats why i was looking into MySQL. I guess what im really asking is whats the difference between Access and MySQL, and what advantages and disadvantages do they have?? Everybodys opinion is welcome, it all helps me out. Thanks! ~[MikE]~

View 5 Replies View Related

Connection To MySQL Thru DSN

May 7, 2006

I will create an Access application as a Front end application. The matter is that the users will need to update some data from Internet where there is a MySql server.
I thought in creating a local DSN to connect to that MySql server. Is it right ?
I already created it but... I dont know the code to connect it from Access.
Could you please help me with the code to write in Access ? Im a new with it. sorry.
Or you can send me an example of it in an Access database to: osvaldo@ord.com.ar

Thank you very much
Osvaldo

View 4 Replies View Related

ACCESS And MySQL

May 31, 2006

Hello everybody,

Who can help me.
I want to access a MySQL database with ms access.
I cant seem to get it.

Please help me.

Thanks in advance,
John

View 2 Replies View Related

Acces Or MySQL

Oct 16, 2006

Which is better fo running a website which is small?

MySQL or Access?

Sathu

View 1 Replies View Related

Convert To MySQL

Mar 28, 2008

I notice there is a lot freeware for converting Access database to MySQL. Can anyone recommend one that they've used (with no adware!).

Thanks,
GG.

View 3 Replies View Related

MySQL Issue

Jul 18, 2005

I have a split db that is currently on our server. We loaded MySQL onto the server as well. I need to run the db from MySQL, and the person that was working this project before me is now gone. I have no idea where he left off, or what he did to get it to this point. When we try to open the db we get an error message that there is a connection problem with the ODBC. We've installed the most recent patches with no success. This may sound like a really stupid question, but do I need to run the upsizing wizard for this thing to work properly? Thanks for any help you can provide.

View 4 Replies View Related

Access And MYSQL

Aug 25, 2003

Hello to all
this is my first post

i am havinga problem with my access database
so i started to converted it to MYSQL

but after converting it and running asp script it gives the following error

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E09)
[TCX][MyODBC]You have an error in your SQL syntax near 'SELECT tblTopic.Topic_ID FROM tblTopic WHERE tblTopic.Forum_ID = 4 ' at line 1
/mycplus/forum/Default.asp, line 335


and the orignal sql statement in ASP Forums is

strSQL = "SELECT " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Thread.Topic_ID, " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message_date "
strSQL = strSQL & "FROM " & strDbTable & "Author, " & strDbTable & "Thread "
strSQL = strSQL & "WHERE " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID AND " & strDbTable & "Thread.Topic_ID IN "
strSQL = strSQL & " (SELECT " & strDbTable & "Topic.Topic_ID "
strSQL = strSQL & " FROM " & strDbTable & "Topic "
strSQL = strSQL & " WHERE " & strDbTable & "Topic.Forum_ID = " & intForumID & " "
'strSQL = strSQL & " ORDER BY " & strDbTable & "Topic.Last_entry_date DESC) "
'strSQL = strSQL & "ORDER BY " & strDbTable & "Thread.Message_date DESC;"

it was fully working in ASP + Access forums

Thanks
Plz help me


View 2 Replies View Related

MySQL, PostgreSQL Or MSDE ?

Sep 8, 2005

Hello,

I'm considering using another database server (than Access). The application has more and more users so I would like to upgrade the server to a better DBMS in terms of robustness, security and performance.

The client will remain an access application.

I made my short list but it remains open to include another DBMS : MSDE, SQL server, MySQL, Postgres, ...

Do you have any information that could help me to make the best choice, such as :
- benchmark reports
- compare analysis
- case studies
- your opinion
...

View 1 Replies View Related

Using Access As A Front End To MySQL

Sep 16, 2005

I have Microsoft Access on my desktop connecting to a MySQL database at my host, using an ODBC driver. I can read the data just fine. But when I try to add another record, it won't seem to do it.

Is it possible to update a MySQL database from MS Access on my desktop?

I have just one table. Very simple. Is it to do with primary key number generation or something?

Thanks,

Jon

View 1 Replies View Related

Connecting To MySql From Access

Feb 26, 2006

Hi all,

hope someone can help me with this.

Before we moved webhosting company we could have external access to our MySql database which was great as our MS Access system would periodically pull data from our MySql site (namely customer enquiries which were entered via a form on our website) and dump them in our MS Access live quotes table all automatically.

With our current host (which seems to be the norm from my web-searches) they only allow local access to the MySql system.

My question is, how can I oversome this hurdle without having to move hosting company. I really don't want to move again as it's a real pain.

All suggestions welcome.

ahrint

View 2 Replies View Related

Importing Data From MySql

Apr 5, 2006

Hi,

is there any other way to import data from a MySql database then via MyODBC I'm experiencing quite some problems with it (v3.51.12)? , especially with character coding...

thx
Miha

View 6 Replies View Related

Looking For Experienced Access/MySQL Developer

Nov 10, 2005

I have an existing MS Access/MySQL app that I need an experience developer to develop further. The existing application is fairly complex, so experienced developers only.

View 2 Replies View Related

MS Access Distribution With MySQL Backend.

Feb 2, 2007

On my development machine everything works great, but I know that I'm going to run into problems with distribution.

I don't think there is a way, but I'll ask. Is there any way to get around not having to install the ODBC MySQL drivers on each computer? One of the reasons I'm migrating to MySQL for a backend is the fact that I'll be going from 10 users to 150 users, each of which has a "locked down" PC, which would mean logging into each with Admin rights to install the driver. Not an impossible task, but a pain.

Is is possible to have a "shared" source for the driver? I have only a rudimentary understanding of that process.

Thanks in advance for any help that someone can provide, or some answers pointing me in the right direction.

View 1 Replies View Related

Linking Access To MySQL Issues

Jun 8, 2007

I have converted my MS Access database tables to MySQL Server tables. I am trying to use the MS Access front end to cooperate with the MySQL Backend database. I have created a system DSN, without problems.

My issue is when I Open MS Access --> Open File --> Files of Type: ODBC Databases, nothing happens. It does not give me the option to connect to the MySQL database I just created. I also tried to import data by linking tables (again, choosing the ODBC databases option), and it does the same thing. Does anyone know what I may be doing wrong?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved