473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

vbscript memvar manipulation.

3
Hello,
I am trying to interface serial data logging to msaccess database.
Following macro-module-code works fine.

Function GetCPSData()

Dim ChannelNumber As Variant
Dim MyData As String
ChannelNumber = DDEInitiate("CPSPLUS", "DRIVER")
MyData = DDERequest(ChannelNumber, "COM1_VALUE")
DDETerminate ChannelNumber
If Len(MyData) = 0 Then Exit Function


Dim MyDB, MyTable
'Dim MyDB As Database, MyTable As Recordset
' NOTE!!! For Access Versions earlier than 2000


Set MyDB = CurrentDb()
Set MyTable = MyDB.OpenRecordset("TABLE1")

MyTable.AddNew
MyTable![serialdata] = MyData
MyTable.Update
MyTable.Close

End Function fine.

But I need to use part of mydata string

If I make following change I get fail sql statement error

Function GetCPSData()

Dim ChannelNumber As Variant
Dim MyData As String
Dim X As String
Dim Y As String
ChannelNumber = DDEInitiate("CPSPLUS", "DRIVER")
MyData = DDERequest(ChannelNumber, "COM1_VALUE")
DDETerminate ChannelNumber
If Len(MyData) = 0 Then Exit Function

X = Mid$("MyData", 16, 21)
Y = Mid$("MyData", 22, 25)

Dim MyDB, MyTable
'Dim MyDB As Database, MyTable As Recordset
' NOTE!!! For Access Versions earlier than 2000


Set MyDB = CurrentDb()
Set MyTable = MyDB.OpenRecordset("TABLE1")

MyTable.AddNew
MyTable![serialdata] = MyData
MyTable![x] = x
MyTable![y] = y
MyTable.Update
MyTable.Close

End Function


What is needed?
Jun 20 '07 #1
0 783

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

Similar topics

4
by: John Benson | last post by:
Hi, I'm in a tightly-secured environment where I may not be allowed to use Python for some scripting work, and may have to fall back on what came with Windows 2K. I'm cracking "VBScript in a...
29
by: Christopher Brandsdal | last post by:
If I have a .ASP page that runs JScript code - is it possible to include an ..ASP page that runs VBscript???
20
by: Harag | last post by:
Hi All. I'm stating out doing some web developing. I was wondering which of the server side languages should I concentrate on and learn. I Know CSS, HTML, T-SQL I can look at the client...
16
by: Mike Schinkel | last post by:
Does anyone know if there are bugs in VBScript's GetRef()? I'm using VBScript Version 5.6.8515 on Win2003Server w/ASP. Sometimes it returns an object that VarType() says is a vbObject. Other...
9
by: Pete | last post by:
Does anyone have a simple html vbscript or other type of snippet they can share that appends a record to a access database via ADO or DAO? I would like to allow users that don't have Microsoft...
2
by: | last post by:
Hi all, I'm here to humbly request some "gimme" help from the group. I discovered the infinite wonders of VS.NET 2005 and ASP.NET 2.0 at Tech Ed a couple of weeks ago, and since returning to...
6
by: rishabhshrivastava | last post by:
Hello All, I am using ASP.NET 2.0 and I am experiencing a problem using vbscript that is this script on client side is preventing the postback of my controls. I have a dropdownlist which is...
0
by: L'eau Prosper Research | last post by:
Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases new TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set. L'eau Prosper Market...
0
by: L'eau Prosper Research | last post by:
NEW TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set By L'eau Prosper Research Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases...
0
by: Jason Huang | last post by:
Hi, In my C# 1.1 Windows form project, I would like to export record to Excel 2000 spreadsheet Record.xls. I also need to do some data manipulation in the Record.xls. How do I call the VBScript...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.