473,805 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help with changing code from access to mysql database

17 New Member
Hi

I have a caller ID software that I would like to change from Microsoft Access database to Mysql and was wondering if somebody could help me. The code i currently have is:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub OpenDataBase()
  3.     Set fo = New FileSystemObject
  4.     Set wrk = CreateWorkspace("", "admin", "", dbUseJet)
  5.      If Not fo.FileExists(m_stDataPath & "callerid.mdb") Then
  6.         Set db = wrk.CreateDatabase(m_stDataPath & "callerid.mdb", dbLangGeneral)
  7.         CreatePhoneDB
  8.     Else
  9.         Set db = wrk.OpenDataBase(m_stDataPath & "callerid.mdb")
  10.     End If
  11.     Set rs = db.OpenRecordset("PhoneCalls", dbOpenTable)
  12.  End Sub
  13.  Private Sub CloseDatabase()
  14.     db.Close
  15.     wrk.Close
  16.     Set db = Nothing
  17.     Set wrk = Nothing
  18.     Set fo = Nothing
  19. End Sub
  20.   Private Sub AddRecord()
  21.     Dim lID As Long
  22.     Select Case Len(frmLineInfo.Number.Text)
  23.       Case 0
  24.         frmLineInfo.Number.Text = "No Number"
  25.       Case 1
  26.         Select Case frmLineInfo.Number.Text
  27.           Case "O"
  28.             frmLineInfo.Number.Text = "Unavailable"
  29.             frmLineInfo.CallName.Text = "Unavailable"
  30.           Case "P"
  31.             frmLineInfo.Number.Text = "Blocked"
  32.             frmLineInfo.CallName.Text = "Blocked"
  33.        End Select
  34.     End Select
  35.     Select Case Len(frmLineInfo.CallName.Text)
  36.       Case 0
  37.         frmLineInfo.CallName.Text = "-"
  38.       Case 1
  39.         Select Case frmLineInfo.CallName.Text
  40.           Case "O"
  41.             frmLineInfo.CallName.Text = "Unavailable"
  42.           Case "P"
  43.             frmLineInfo.CallName.Text = "Blocked"
  44.         End Select
  45.     End Select
  46.      With rs
  47.         If (.RecordCount > 0) Then
  48.             .MoveLast
  49.             lID = .Fields("id") + 1
  50.         Else
  51.             lID = 1
  52.         End If
  53.         .AddNew
  54.         .Fields("id") = lID
  55.         .Fields("datetime") = Now
  56.         .Fields("number") = frmLineInfo.Number.Text
  57.         .Fields("name") = frmLineInfo.CallName.Text
  58.         .Update
  59.     End With
  60.  End Sub
  61.  Private Function CreatePhoneDB() As Recordset
  62.     Dim tbl As TableDef
  63.     Set tbl = db.CreateTableDef("PhoneCalls")
  64.     With tbl
  65.         .Fields.Append .CreateField("id", dbLong, 4)
  66.         .Fields.Append .CreateField("datetime", dbDate, 4)
  67.         .Fields.Append .CreateField("number", dbText, 20)
  68.         .Fields.Append .CreateField("name", dbText, 20)
  69.         db.TableDefs.Append tbl
  70.     End With
  71.     Set db = wrk.OpenDataBase(m_stDataPath & "callerid.mdb")
  72.     Set tbl = db!phonecalls
  73.     Set idx = tbl.CreateIndex("DateTime")
  74.     idx.Fields.Append idx.CreateField("datetime")
  75.     tbl.Indexes.Append idx
  76.   End Function
  77.  
  78.  
  79.  
Nov 11 '08 #1
4 1632
debasisdas
8,127 Recognized Expert Expert
try to use ADODB library for the purpose.
Nov 11 '08 #2
psycho007
17 New Member
Sorry im a php coder not a VB6 coder. I was wondering if you could be a little more specific? any links for this would be appreciated.

Thanks
Nov 11 '08 #3
debasisdas
8,127 Recognized Expert Expert
you mean to say all the code you have posted is in PHP ?

why you have posted the question here , why not in PHP forum ?
Nov 11 '08 #4
psycho007
17 New Member
no the code is vb6 no php. the vb6 code needs changing from a access database to mysql database
Nov 11 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4428
by: Neil | last post by:
Hi, I hope this question isn't too far off topic....I'm almost at my wits end trying to figure this out. I have a Mysql database and I wish to automate the backup of the database because I don't wish to rely on the web host doing so. I am using the "dbsender.php" script, which is written for this exact purpose (available at hotscripts.com). If I execute the script via my browser, the database is emailed to me in a 'gzip' format, which...
0
2099
by: Dafella | last post by:
The following is code from Xeoport. It is suppose to access my pop3 account and load email into Mysql database. It's not inserting and there is no log or anything to tell me why. Here is the page. http://www.dafella.com/xeoport/ The original coder left no contact info. The reason I think it's the code is because of another issue.
4
9342
by: Mark Wilson CPU | last post by:
A colleague has written a prototype program in PHP, using a MySQL database. It's a relatively simple app, with a restricted set of mysql commands used (see below). The MySQL DB is being replaced with an Oracle DB (same schema). My plan 1) globally replace the few mysql commands with intermediate equivalents (such as myDB_connect for mysql_connect) 2) those central functions would then (for now) call the original mysql function to prove...
3
3356
by: cooldv | last post by:
i am running a website on Windows 2000 server with ASP 3 webpages and Access 2000 database. (with a hosting company) traffic is slow at this time but expect to grow. lately i have been reading about sql database and sql server, specially this article: http://www.aspfaq.com/show.asp?id=2195 will someone help me understand: 1. with *SQL Server*, do i keep my current Access 2000 database and ASP pages?
2
1516
by: David Heller | last post by:
I have this schema I exported from a database running mysql version 4.01 I'm trying to create this table on a server running mysql 3.23 I keep getting a syntax error near line 11 (I added the line numbers for clarity. I think it has a problem with the Table Field "ORDER#" I do have it quoted as shown below so why do I keep getting syntax errors? I also have problems with the Table Fields "BY" and "DESC" and they are quoted the same way....
2
1688
by: Daven Thrice | last post by:
Hi, I've converted the tables from an old Access application to MySql format. I then linked the tables into access using MyODBC and everything works great (on my computer). For now, I want to keep Access as a front end, and move the tables to the Internet. I feel like I'm lost in a maze or something with some really basic questions. What do I need in terms of a host? I have been looking at ipowerweb because they have a reseller...
8
5484
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
2
1846
by: Vladislav Moltchanov | last post by:
Recently I have changed from Acc97 to Acc2000 (I had to supply some data entry tools for field data collection for users still using Acc97). Among lot of other complications coming with Acc2000 (compared with very reliable acc97) I have got problem with Help: In access 2000 all topics with DAO are listed in index but otherwise not available, so I am using two PCs when developing something, to have advantage of ACC97 help, where all these...
2
3010
by: PHP_Paul | last post by:
Ok, I'm trying to poineer into the wonderful area of PHP/MySQL programming, but I'm having some difficulties. http://www.paulhq.com/php/freepage.html should register, but when anyone fills something out, it returns a MySQL error: Could not insert data because You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 Here are the codes: freepage.html...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10609
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10360
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5542
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3845
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.